Fixes order by distance