refactored and added length validation to Tags