chatbox logic update