fix the if statement