bugfix required = true

if val is an empty string, change to undefined so validation fails