fix to how with_leaves builds on previous filters