code for chatbox