updated query for location based retrieval