order sync logic