Added logical negation

So that this if works as intended.