added new logic to app.js