scoped out the var

scoped out the var inside and outside the function