Fixing distance bug in html