fixed distance bug