adding support for autosave