adding chat server code