fixed the filtering of categories