Add a default filter function if none provided