Fixed div by zero issue