fix bug: shutdown server unexcepted.