fix failed kill thread when disconnect
resolve complex method