Fix inverted check