Maybe swap the clauses around (and change the test from != to ==, of course.)