fix: writeFile bug