update distance query to be more accurate