attempts to make filter less fragile
Merge pull request #163 from mikedewar/filterfix

attempts to make filter less fragile