Fixed Error closing the windows when done btn pressed.