added validation to categories