adds validation for min-max length