added support for custom predicates