modified web.js to do live preview