Moved the windows destruction