sync logic