fix accuracy of distance