fix window reference