fixed issues with sorting by distance after first import