compiles with new filtering but behavior is erratic