Bug fix to custom filter