don't forget to close (and thus, flush) the writer.