fix for vector distance (thx brane)