
    Town of Putnam Valley, Respondent, v Ann Marie Sacramone, Appellant.
    [792 NYS2d 191]—
   In an action to enjoin the defendant, inter alia, from performing construction work without a building permit or occupying certain premises without a certificate of occupancy, the defendant appeals from so much of an order of the Supreme Court, Putnam County (Sweeny, J.), dated August 5, 2003, as, upon re-argument, vacated its prior order dated November 22, 2004, and granted the plaintiffs motion for summary judgment.

Ordered that the order is affirmed, with costs.

The defendant’s contention that the Supreme Court improperly granted summary judgment based upon an unpleaded cause of action is without merit. Although the Supreme Court granted summary judgment pursuant to Putnam Valley Zoning Law § 165-44, which was not pleaded in the complaint, summary judgment was properly granted under that section because the proof supported a cause of action under that section, and because the defendant was not misled or prejudiced as to that section’s application to the dispute (see Scalia v Glielmi, 200 AD2d 615, 615-616 [1994]; Deborah Intl. Beauty v Quality King Distribs., 175 AD2d 791, 793 [1991]; Rubenstein v Rosenthal, 140 AD2d 156, 158 [1988]).

In addition, contrary to the defendant’s argument, the plaintiff is not estopped from acting to enforce its building code. It is undisputed in this case that a building permit increasing the height of the subject property was issued to the appellant in error. Under these circumstances it is well settled that “estoppel may not be invoked against a municipal agency to prevent it from discharging its statutory duties” nor for the “purpose of ratifying an administrative error” (Matter of Parkview Assoc. v City of New York, 71 NY2d 274, 282 [1988] [internal quotation marks omitted]; see Baris Shoe Co. v Town of Oyster Bay, 234 AD2d 245 [1996]). A building permit could not confer rights in contravention of the zoning laws, and “estoppel is not available to preclude a municipality from enforcing the provisions of its zoning laws and the mistaken or erroneous issuance of a permit does not estop a municipality from correcting errors, even where there are harsh results” (Matter of Parkview Assoc. v City of New York, supra at 282; see also McGannon v Board of Trustees, 239 AD2d 392 [1997]).

The defendant’s remaining contentions are without merit. Florio, J.P., H. Miller, Cozier and S. Miller, JJ., concur.  