fix exception of divide by zero