Fix to if statement