update sync() routine