updated web.js with new middleware changes