fix writing.