Modified app.js to fix path undefined error
Modified them files to retrieve field values the right way