bug fix for division by zero