working on javascript to implement the chat client