Added code to Chatclient