Fix bug may cause ServerThread crash