Added a function to app.js