solve division by zero bug