add chat function based on socket.io