Add setFilterFunction method