now the last window state is saved