fixing up the filter method