change the process of creating window