Fix/add trail distance check

- add a distance check for trails.