Changes in syncing and Add database functions