Update index.js

Fixes a global leak. HT @ananthakumaran
Merge pull request #97 from sreeix/patch-1

Update index.js