Move the check to the else.