fix bugs for chat room