¶1The Commonwealth and the defendant agree that the grounds on which a judge of the Boston Municipal Court dismissed two counts of the complaint against the defendant were invalid.
¶2To be sure, “[a]n appellate court is free to affirm a ruling on grounds different from those relied on by the [trial court] judge if the correct or preferred basis for affirmance is supported by the record.” Commonwealth v. Va Meng Joe, 425 Mass. 99, 102 (1997). However, we are not required to do so, and we decline in the present circumstances to exercise our discretion to consider in the first instance the alternative ground now suggested by the defendant. Put simply, we see no benefit in the interest either of justice or of judicial economy in sustaining dismissal of counts 2 and 3 of the complaint. The defendant has made no showing that the claimed deficiency caused him any confusion or uncertainty regarding the nature or source of the charges against him.
¶3Our dissenting colleague suggests that we are compelled to determine the sufficiency of the complaint, because it is a matter of subject matter jurisdiction. We disagree. Of course it is true that, as the dissent observes, a deficiency of subject matter jurisdiction may be raised at any time, and a complaint that fails to state a crime deprives the court of jurisdiction to entertain it. However, that does not mean that we are compelled to consider and determine the sufficiency of the complaint in the circumstances of the present case. In the cases cited by the dissent, the defendant had already been convicted by the time the jurisdictional defect was presented before the reviewing court. See Commonwealth v. Andler, 247 Mass. 580, 581-582 (1924); Commonwealth v. Cantres, 405 Mass. 238, 239-240 (1989). Accordingly, the question before the court in those cases was whether to sustain a conviction based on a legally deficient complaint. More importantly, in our view, following conviction it was no longer open to the Commonwealth or the court to remedy deficiencies in the form of the complaint. By contrast, in the present case, the case has not advanced beyond pretrial proceedings.
¶4As we have observed, by raising his claim in the first instance on appeal, the defendant has precluded resort to any such curative measures, were we to consider and determine it. Moreover, though the claim is one of subject matter jurisdiction, by declining to consider it in the first instance we are not entertaining the complaint in its substance, but are simply returning it to the trial court for consideration of the question.
¶5The order dismissing counts 2 and 3 of the complaint is reversed, and the matter is remanded to the Boston Municipal Court for further proceedings consistent with this opinion.
¶6So ordered.
¶7 The defendant was charged in a four-count complaint. Count 2 alleged breaking and entering a “ship or motor vehicle or vessel” in the daytime with intent to commit a felony, G. L. c. 266, § 18. Count 3 alleged larceny of property having a value of $250 or less, G. L. c. 266, § 30. The defendant confessed to police that he had broken into two cars and had taken a stun gun from one of them. His confession was corroborated by the recovery of the stun gun when he *682was pat frisked, his statement that “times [were] tough,” an eyewitness who identified him as the person who had broken into the cars, and the fact that the defendant was covered in glass shards and blood. On that state of affairs the defendant appeared before the judge to enter a guilty plea. After hearing the prosecutor’s recitation of the allegations against the defendant during the plea colloquy, the judge concluded, sua sponte, that counts 2 and 3 should be dismissed because they were unsupported by probable cause.
¶8 Count 2 of the complaint alleged that the defendant “did in the day time break and enter a ship, motor vehicle or vessel, the property of Known to Commonwealth, with intent to commit a felony ...” (emphasis added). Similarly, count 3 of the complaint alleged that the defendant “did steal the property of Known to Commonwealth.”
¶9 Indeed, as we have noted, see note 1, supra, the dismissal of counts 2 and 3 arose during the defendant’s attempt to enter a guilty plea.