fixed division by zero error