Adding a division by zero check