fixed exception caused by quitting the chat