preserve the view state of background states when closing the last window