fixing if statement is backwards