fix memory leak
Merge pull request #34 from kllbzz/issue33

fix memory leak from issue #33