added support for locating by query