fix to how with_leaves builds on previous filters

attempt at fix for leaves filter order of operations problem