wrap Room object in self invoking function