fix window switching