measuring distance error fixed