Updated chat window handler to send chat_id