added validation for categories