some bugfixes to chat