Fix global variable leak
Merge pull request #2 from vin/leak

Fix global variable leak