fix global var leak in view.js