Fix inverted if-statement