Cleaned up confirm code for saving unsaved files