fixed bad if statements