fixed graceful close of clients, worked on ChatClient