Added autosave feature