modified websocket demo to chat application