fix window open problem