fixed memleak

fixing memleak
Merge pull request #101 from tbisanz/memleak

fixed memleak