fix flipped conditional