Fix filtering bug