optimaze the chatbox