add content to main.js, appView.js and some bug fixes