Update validator.js

modify local variable