add sending and receiving messages in chatroom