fixed some if misstatements