Added an option to automatically autosave at the specified interval