add writer.Close();