Add Autosave and restore feature