code to sync orders