fixed bug with autosave