add distance queries support