app.js has bugs