Fixes bug in chat_ui.js