fix bug with autosave