custom filter to add extra condition to PDF attachment