Semi-fixed bug with closing windows that have sub windows