change function fs.writefile to writefilesync