cleaned register.js