Fixed - missing var, poluting global variables
Merge pull request #1174 from dainis/fix-global-var-leak

Fixed - missing var, poluting global variables