Updated web.js to use buffer