Add a call to finish() after write()