added room feature, implemented window closing event