updated code for creating chatrooms