finalize the filter