Modified server side code for rooms