Added chatbox logic