fixed bad conditional