added subcategory length check before building dropdown