Modified web.js to print from index.html