Filter sub

for  #539