write close the writer