Added validation for tags