close file after writing (oops)