update sort distance