bug with distance