better error messages for if statements