added features for distance error