Added a dialog that asks for save confirmation before closing the window
and the program