#1, #3 Euclidean distanc error handling