recoded filter script to adjust to new feature