Adding sync button functionality