Return to the main window when the Cancel button is pressed