Do some changes to the sync code