add filter apply helper function