fixes to make it work on the server or with browserify
required can be set to false