new feature: required may be a string, and the string will be the error message