fixed category and subcategory bugs