Fixing autosave bug