fixing fs.writeFileSync