adding fix for divide by zero