fixed incorrect count when filtering