fix window creation