add main syncing logic from local to remote