update sync function