fix for issue #18

Maybe we can add a comment that 
defaultValue only need to be set when required = false.