fix bug in `filter`