modified web.js, second attempt