Use async writeFile function