Fixed bug with subcategories