Fixed a bug related to having open windows that close while opening a new window