fixed a bad if statement