Scoping tag in if statement