why do you assign this var before the if statement