fix promises on view.js