fixed querying issue