Implemented handlers to deal with unsaved changes upon attempting to
close the application