Modified app.js for callback