saving unsaved maps when closing