division by zero fix, conditional exception inclusion