fixed the if statement