updated fs.write fn in web.js