correcting an if statement