Changed var scope
Merge pull request #1 from panicnot42/master

Changed var scope