Fix issue with distance