Fixed the bug of joining the room and simplified the client state