fix write.