Fix bug in filter