updated app.js with reg