check distance