add predicate function to select