added two way filtering