added cleanup method
Merge pull request #1 from massiveart/bugfix/js-memory-leak-hunting

added cleanup method