check for divide by zero for modulus