Update write.js