Fixed a chat crash bug