implemented AutosaveThread class to handle autosaving the core