fixed bug which resulted in dividing by zero