Fix document undefined error when adding subcategory tile