Var redeclaration bug