bug fixes to chat