database autosave implemented