forgot to invert an if statement