changes to validator.js