validate category and subcategory