Updated app.js client code