fixed illigeal state exception while shutting down
Merge pull request #84 from miyuru/master

fixed illigeal state exception while shutting down