removed var so the variable has the right scope