distance bug fixed