the last save must be done in the main thread

otherwise, it gets killed