Appeal from a judgment of the County Court of Schenectady County (Catena, J.), rendered March 31, 2004, upon a verdict convicting defendant of the crimes of criminal possession of a controlled substance in the third degree and criminal possession of a controlled substance in the fourth degree.
Two days after a controlled drug buy between defendant and a confidential informant, the police raided an unoccupied apartment building where they found crack cocaine and arrested defendant. He was charged with criminal sale of a controlled substance in the third degree and criminal possession of a controlled substance in the third degree in connection with the drug buy, and criminal possession of a controlled substance in both the third degree and the fourth degree in connection with the raid. After trial, the jury found him guilty of the two charges arising out of the raid and acquitted him of the other two counts.
On his appeal, defendant contends that the People failed to present legally sufficient evidence to prove the elements of possession and intent to sell necessary to sustain his conviction of criminal possession of a controlled substance in the third degree (see Penal Law § 10.00 [8]; § 220.16 [1]). The issues are not properly preserved, however, because his general motion to dismiss at the close of the evidence did not direct County Court’s attention to these specific deficiencies in the People’s proof (see People v Gray, 86 NY2d 10, 19-20 [1995]; People v Fallen, 249 AD2d 771, 771 [1998], lv denied 92 NY2d 879 [1998]). Were we to consider the issue of possession, we would note that there was evidence that defendant was alone in the building when the raid began, he was observed throwing packaged cocaine out of a bedroom window during the raid and he was confronted by the police as he emerged from that same bedroom where additional cocaine was then found. This evidence was sufficient to demonstrate his dominion and control over the drugs (see People v Richardson, 28 AD3d 1002, 1004-1005 [2006], lv denied 7 NY3d 817 [2006]). Similarly, as for the issue of intent to sell, we would conclude that the more than 5.8 grams of cocaine found in defendant’s possession and the fact that it was divided into 62 individual plastic packets support the inference that he possessed the cocaine for resale (see People v Belo, 240 AD2d 964, 966 [1997], lv denied 91 NY2d 869 [1997]). Although the police officers improperly testified that cocaine in such quantity and packaging evinced an intent to sell, the error was harmless *1132under the circumstances here (see People v Berry, 5 AD3d 866, 867 [2004], lv denied 3 NY3d 637 [2004]; People v Wright, 283 AD2d 712, 713-714 [2001], lv denied 96 NY2d 926 [2001]). Further, the jury’s finding of guilt was not against the weight of this evidence.
Nor are we persuaded that County Court made an incomplete Sandoval ruling which prevented defendant from making an informed choice as to whether to testify at trial. Although County Court stated initially that it was “reserving on [proffered items] 9 through 18 to await the testimony,” it then added that “at this time I will not permit any inquiry, but again, that may change depending on the testimony.” The court then fully explained what it meant in a colloquy with counsel. Our review of the record satisfies us that the court denied items 9 through 18 of the People’s Sandoval application while recognizing that defendant could “open[ ] the door” by testifying to facts which are in conflict with the otherwise precluded evidence (People v Rodriguez, 85 NY2d 586, 591 [1995]; see People v Fardan, 82 NY2d 638, 646 [1993]; People v Brown, 252 AD2d 598, 600 [1998], lv denied 92 NY2d 923 [1998]). Nothing in the record suggests that defendant misunderstood the court’s ruling in deciding whether to testify.
Nor was County Court mandated to give limiting instructions regarding the jury’s consideration of evidence of certain prior bad acts despite his counsel’s choice to forego them (see CJI2d[NY] Molineux). This issue is also unpreserved for appeal (see People v Smith, 41 AD3d 964, 965 [2007], lv denied 9 NY3d 881 [2007]; People v Williams, 25 AD3d 875, 876 [2006], lv denied 6 NY3d 854 [2006]). Were we to consider it, we would note the extensive discussions on the record as to whether such an instruction would be given and find that there was no reversible error because of defense counsel’s clearly expressed opposition to such an instruction for tactical reasons (see People v Smith, 41 AD3d at 966; cf. People v Russell, 16 AD3d 776, 778 [2005], lv denied 5 NY3d 809 [2005]).
Finally, although defendant contends that he was denied the effective assistance of counsel, we conclude that it was meaningful in the totality of the circumstances here (see People v Baldi, 54 NY2d 137, 147 [1981]). “As long as the defense reflects a reasonable and legitimate strategy under the circumstances and evidence presented, even if unsuccessful, it will not fall to the level of ineffective assistance” (People v Benevento, 91 NY2d 708, 712-713 [1998] [citation omitted]). Significantly, counsel was successful in obtaining defendant’s acquittal of the two B felonies arising out of the controlled drug buy. With the excep*1133tion of the mistaken eliciting of testimony as to a prior drug sale, counsel’s conduct of the defense with regard to the raid reflected a considered and reasonable strategy to persuade the jury that someone else had stored the cocaine in the raided apartment. Moreover, contrary to defendant’s claim, the record reflects that counsel did object to the testimony of police officers that the quantity of drugs recovered evinced an intent to sell. Accordingly, we do not find that counsel’s inadvertent revelation of a prior drug sale during cross-examination constitutes ineffective assistance (see e.g. People v Whitehead, 23 AD3d 695, 697 [2005], lv denied 6 NY3d 840 [2006]).
Cardona, P.J., Mugglin, Lahtinen and Kane, JJ., concur. Ordered that the judgment is affirmed.