Added thread for autosaving (cahce->database)