added function to app.js