pondering how to work window state saving