Adding sync code