
    The People of the State of New York, Respondent, v Randolf Jenkins, Also Known as Rudolph Jenkins, Appellant.
   —Appeal by the defendant from a judgment of the Supreme Court, Queens County (Browne, J.), rendered May 13, 1988, convicting him of criminal sale of a controlled substance in the third degree and criminal possession of a controlled substance in the third degree, upon a jury verdict, and imposing sentence.

Ordered that the judgment is reversed, on the law, and the indictment is dismissed, with leave to the People to resubmit the charges to a different Grand Jury.

The prosecutor’s failure to charge the Grand Jury with respect to the complete defense of agency necessitates dismissal of the indictment. Further, and as the People concede, the trial court committed reversible error in subsequently denying the defendant’s request for an agency charge.

It is well settled that "one who acts on behalf of a purchaser of drugs cannot be convicted of criminal sale of a controlled substance, or of criminal possession thereof with intent to sell” (People v Perez, 60 AD2d 656; see, People v Roche, 45 NY2d 78, 81, cert denied 439 US 958; see also, People v Argibay, 45 NY2d 45, cert denied sub nom. Hahn-DiGuiesppe v New York, 439 US 930; People v Torres, 150 AD2d 816; People v King, 150 AD2d 497, 498; People v Miano, 143 AD2d 777). The "question of whether a defendant acted as an agent of the buyer or as a seller in a drug transaction is a factual determination for the jury to resolve based on the circumstances of a given case” (People v King, supra, at 498; People v Miano, supra). Moreover, "where there is some reasonable view of the evidence that a defendant acted as an instrumentality of the buyer rather than as a seller, the court must, upon a timely request, charge the jury as to the defense of agency” (People v King, supra, at 498; People v Cierzniewski, 141 AD2d 828).

At bar, there was evidence before the Grand Jury clearly supporting the claim of the agency, and accordingly, the prosecutor was obligated to instruct the Grand Jury with respect to the defense (see, e.g., People v Lancaster, 69 NY2d 20, 26; People v Valles, 62 NY2d 36, 39). Since the prosecutor failed to so instruct the Grand Jury, the indictment must be dismissed with leave to resubmit the charges (see, CPL 210.20 [1] [c]; 210.35 [5]; People v Valles, supra; People v Perez, 60 AD2d 656, supra; People v Lindsey, 16 AD2d 805, affd 12 NY2d 958; cf., People v Nunez, 127 AD2d 801, 802; People v Dixon, 87 AD2d 828). Moreover, the defendant also presented testimony at trial establishing his entitlement to an agency charge, which was erroneously denied by the trial court.

We note, finally, that the trial court also committed reversible error in declining to permit the defendant to be present during the Sandoval hearing. As the Court of Appeals has recently observed, ”[a] defendant has a fundamental right to be present at all material stages of a trial” (People v Mehmedi, 69 NY2d 759, 760; see also, People v Ciaccio, 47 NY2d 431, 436). This principle applies to a Sandoval hearing (see, People v Peterson, 151 AD2d 512). Contrary to the People’s contentions, the Court of Appeals has declined to apply harmless error analysis where the defendant has been erroneously excluded from a material part of the trial (see, People v Mehmedi, supra, at 760). In any event, we note that during the Sandoval hearing, a dispute arose with respect to the accuracy of the defendant’s NYSID sheet concerning the nature of a prior crime. The court’s ruling, however, effectively precluded the defendant from assisting his trial counsel in resolving the dispute, thereby resulting in prejudice to the defendant and underscoring the importance of his right to be present during the proceeding. Mollen, P. J., Mangano, Kunzeman and Kooper, JJ., concur.  