Added autosave and load function