added ability to remember the window state from last run.