sync logic improved