fixed the divide by zero