adding sync to both master and slave