working sync_db