fix some bugs in app.js