fix issue with distance calcs