corrected euclidean distance error