fix window bug