before_filter for categories and subcategories