fixing divide by zero error