adds querying by predicate