fixed tb closing client when exited abruptly