Fixed bug in the creation of a new window