updata with new distance