Use writeFileSync because async version is broken (???)