fix possible devision by zero