update to check the window var