querying fixes