Use writeFileSync instead of writeFile