fix bug: shutdown server unexcepted.
Merge pull request #491 from forumbyr/master

fix bug: shutdown server unexcepted.