add tracing for filter function