Wrong logic in filter method