Auto save on close or location change.