fix division by zero error