Edit:
Added some code to gracefully catch a bug in filter