Removed unnecessary writer.Close()