Fixed error occurring on exit
Merge pull request #3 from franklinwk/master

Fixed error occurring on exit