After jury verdicts of guilty of possession with intent to distribute cocaine on separate indictments, the defendant, Myles Miranda, appeals, arguing that the judge erred in denying his two pretrial motions to dismiss the indictments. In particular, the defendant contends that: (1) false testimony given during the first grand jury proceedings impaired the integrity of those proceedings, warranting dismissal of both counts of indictment no. 44070; and (2) it was error for the judge to reinstate count II of indictment no. 44070 three months after nolle prosequi had been entered on that indictment, irremediably tainting the trial of the other indictment. We granted the defendant’s application for direct appellate review. We conclude that the judge erred when he reinstated count II of indictment no. 44070, thereby prejudicing the defendant, and requiring reversal of the convictions.
The judge found the following facts in his memorandum and order on the defendant’s motion to dismiss. On November 7, 1989, Detective Robert Nolan of the Falmouth police department testified as the sole witness before the Barnstable County grand jury.1 His testimony was based on reports pre*3pared by an undercover narcotics officer regarding the defendant’s involvement with narcotics transactions on May 26 and May 29, 1989. Detective Nolan inaccurately described the defendant’s involvement in the drug transaction on May 26, and misstated the amount of drugs sold on May 29.2 Subsequent to the detective’s testimony, the grand jury returned a two-count indictment, no. 44070, against the defendant, for possession with intent to distribute narcotics on May 26 and May 29, 1989.
On June 8, 1990, the defendant filed a motion to dismiss the indictment when he discovered discrepancies between Detective Nolan’s testimony and the underlying police report. On July 10, 1990, the Commonwealth obtained a curative indictment having represented the May 26, 1989, matter to the grand jury through testimony by the undercover narcotics officer. The grand jury returned a one-count indictment, no. 44362, for possession with jntent to distribute narcotics (cocaine) on May 26, 1989. When the defendant appeared in court on July 26, 1990, to answer to indictment no. 44362, his bail was transferred from indictment no. *444070 to no. 44362. On August 16, 1990, the Commonwealth filed a nolie prosequi on indictment no. 44070, noting thereon that it was “superseded by indictment 44362.”3 Neither the document nor the cover letter made any reference to the separate counts of the indictment.
On November 8, 1990, the defendant appeared ready for trial on indictment no. 44362 when, by oral motion, the Commonwealth moved to vacate the nolie prosequi entered on count II of indictment no. 44070 claiming that it had been entered in error. The judge allowed the motion subject to a full hearing. After a hearing held on November 28, 1990, the judge denied both the defendant’s June 8, 1990, motion to dismiss, and his second motion to dismiss filed on November 26, 1990.
Ruling on the first motion to dismiss, the judge found that Detective Nolan’s error was an “innocent mistake that did not even relate to the indictment in issue.” Further, he ruled that the detective’s testimony was otherwise clear and adequate regarding the defendant’s activities on May 29, 1989, and the discrepancy in the amount of cocaine sold did not go to any essential element of the alleged crime. On the second motion to dismiss, the judge ruled that the nolle prosequi of the entire first indictment had been “a mistake, oversight, and unintended act.” Noting that the defendant had not asserted a double jeopardy claim, the judge determined that Mass. R. Crim. P. 42, 378 Mass. 919 (1979), permitted the judge, on the Commonwealth’s motion, to correct the errors in the record. After a trial conducted on indictment no. 44362, and the revived count II of indictment no. 44070, the jury found the defendant guilty. The defendant was sentenced to concurrent terms of from five to ten years at the Massachusetts Correctional Institution at Cedar Junction.
We turn first to the second motion to dismiss because this issue is dispositive of the appeal.
*5Reinstatement of the nolle prossed indictment. The defendant contends that the judge erred in denying his second motion to dismiss and allowing the reinstatement of count II of the previously nolle prossed indictment. He argues that the action deprived him of his right to be free from criminal prosecution unless indicted by a grand jury. Connor v. Commonwealth, 363 Mass. 572, 576 (1973). The Commonwealth argues that the judge had authority to vacate the nolle prose-qui as a clerical error pursuant to Mass. R. Crim. P. 42. Commonwealth v. Mandile, 15 Mass. App. Ct. 83, 86 (1983). We conclude that it was error to reinstate the indictment.
“Clerical mistakes in judgments, orders, or other parts of the record and errors therein arising from oversight or omission may be corrected by the court at any time of its own initiative or on the motion of any party.” Mass. R. Crim. P. 42. Such mistakes, however, do not include or apply to the correction of errors of substance. See Commonwealth v. Snow, 269 Mass. 598, 609-610 (1930) (amendment that goes to matter of substance is unconstitutional and cannot be authorized); Commonwealth v. Layne, 25 Mass. App. Ct. 1, 3-4 (1987) (judge cannot correct a clerical mistake under rule 42 on the basis that record does not accurately reflect intent); Commonwealth v. Saya, 14 Mass. App. Ct. 509, 511 (1982) Gudge cannot amend or correct if it would cause a material change in substance or in essential element of crime); K.B. Smith, Criminal Practice and Procedure § 2466 (1983) (errors of substance such as an illegal sentence or improperly obtained conviction do not fall within purview of clerical errors); 8A Moore’s Federal Practice par. 36.02, at 36-1 — 36-3 & n.1 (2d ed. 1993) (correction or modification of sentence is not clerical mistake). Material or substantial errors are not ones of transcription, copying, or calculation, but are those that trample the defendant’s rightful expectations. United States v. Cina, 699 F.2d 853, 857 (7th Cir. 1983). Here the Commonwealth obtained a subsequent indictment, filed a nolle prosequi of the original indictment, transferred the defendant’s bail from the original to the sub*6sequent indictment, and informed the defendant that trial would proceed on the subsequent indictment alone. A defendant has a right to be definitely informed of the charge against him in order to facilitate his ability to prepare a defense and in order to prevent his being taken by surprise at trial. It is palpably unfair for the Commonwealth to file a nolle prosequi on both counts of the original indictment, and then attempt to resurrect count II on the day of trial. In these circumstances more than the correction of a clerical error was at stake. The defendant has a rightful expectation that he would not be tried on the charges contained in the earlier indictment absent a new and proper indictment.
The Commonwealth’s reliance on Commonwealth v. Al-drich, 21 Mass. App. Ct. 221, 226 (1985), is misplaced. There, complaints had been dismissed in the District Court after guilty pleas based on the assumption that the charges would be prosecuted in the Superior Court, and therefore subsequent sentencing in the District Court was not a violation of the defendant’s double jeopardy rights. The Commonwealth also argues that this court has found no due process problems in allowing the withdrawal of a nolle prosequi and revival of a previously valid indictment. Commonwealth v. Rollins, 354 Mass. 630, 632-633 (1968). There, the prosecutor had entered a nolle prosequi in exchange for a guilty plea on a lesser charge. Id. at 632. Subsequently, the defendant moved to retract the plea which the court had allowed, and the prosecutor obtained a new indictment of the defendant. Id. The court indicated that the judge could have alternatively permitted the prosecutor to withdraw his discontinuance of the nolle pressed charge because no prejudice or injustice would arise from placing the parties in the same positions they were in before they entered the plea agreement. Id. at 633. This situation has no application to the facts of this case.
We therefore conclude that the entry of a nolle prosequi three months prior to the date of trial terminated that indictment. The prosecution may choose not to prosecute the whole indictment or separate parts of it. Commonwealth v. Das-*7calakis, 246 Mass. 12, 19 (1923). Here neither the document nor the cover letter made any reference to the separate counts of indictment no. 44070. The defendant, therefore, reasonably relied on the fact that a nolle prosequi had been entered on the whole indictment.
The final consideration is whether reinstating count II of the indictment tainted the entire trial, requiring reversal of both convictions. Count II of indictment no. 44070 involved an alleged hand-to-hand sale of drugs by the defendant to the officer. On indictment no. 44362, the defendant’s role was one of facilitator or “go between,” bringing the officer to meet a person who sold the officer cocaine. Trial on the revived indictment made a conviction more likely on the more peripheral involvement of the defendant in the subsequent indictment.
In sum, therefore, the defendant’s motion to dismiss indictment no. 44070 should have been allowed. The trial of the defendant on that indictment tainted his trial on indictment no. 44362 and requires reversal of that judgment of conviction. The judgments are reversed, the verdicts are set aside, and an order is to be entered dismissing indictment no. 44070.
So ordered.
Detective Nolan’s testimony before the grand jury on November 7, 1989, was as follows:
“On May 26, 1989 at approximately — actually it was — Yes, May 26th, at 12:10 a.m., the [undercover] officer had conversation with a subject known to him as a Myles Miranda at the Falmouth Hotel in Fal-mouth. He asked Mr. Miranda if he had any cocaine for sale. Mr. Miranda stated that he did. He then gave the officer approximately one-eighth of an ounce of cocaine and asked him for $200 in cash, which the officer gave him. It was later analyzed to be, in fact, cocaine; 3.01 grams.
“On the 29th of May, 1989 at approximately 8:15 p.m., the officer was located at the Port-O-Call Bar, or Falmouth Hotel, located on Main Street in Falmouth. The officer observed the subject known as Myles Miranda enter the premises. Miranda, after a few moments, approached the officer, and after a brief conversation the officer expressed a desire to purchase an eight-ball of cocaine. Miranda informed the officer that he could set him *3up with some good rock. He further stated that they’d have to take a ride. The officer went with Mr. Miranda to a house located on Randolph Street in Falmouth. Miranda exited the vehicle, went into the premises, and approximately two minutes later came back out with a clear plastic bag. The bag contained a yellowish, hard substance consistent with that of rock cocaine. He then asked the officer for $175 in cash, which the officer gave him. The substance did, indeed, come back as approximately 2.99 grams of cocaine.”
According to the police report, the defendant did not participate in a direct hand-to-hand sale on May 26, 1989, as Detective Nolan had testified. Instead, after a brief conversation, the defendant offered to take the officer to a person who could sell him cocaine. They drove to a house on Central Avenue in Falmouth, and then to a house in Mashpee. The defendant invited the officer inside where another person sold him approximately one-eighth of an ounce of powder cocaine for $200. While present, the defendant did not participate in the actual transaction. The report indicated that, on May 29, 1989, the defendant did sell the officer cocaine; however, the report does not indicate the street where the transaction occurred. Additionally, the laboratory analysis indicated the amount sold on that date as being 1.99 grams, not 2.99 grams as stated by Detective Nolan.
A district attorney is required to state the reasons for the nolle prosequi “to protect the public’s interest in the integrity of the prosecutor’s decision.” Commonwealth v. Sitko, 372 Mass. 305, 309 n.2 (1977), S.C., 379 Mass. 921 (1980). Mass. R. Crim. P. 16, 378 Mass. 885 (1979).