fixed the division by zero exception