Correcting window reference