Why do you need the second check in the if?