fixed buggy filtering issue