Fix filtering of newly added elements