fix mem leak

major memory leak in the last version
Merge pull request #4 from ksuquix/patch-4

fix mem leak