bug fix divide by zero