fix the bugs when inviting friend to a chat room