Fix sync code