trim then filter
Merge pull request #884 from UncleBill/trim

trim then filter