Fixed comparing current distance with previsous it.