protect against and raise error on division by zero