In an action, inter alia, to declare that plain*847tiff may make necessary excavations and street and sidewalk openings without obtaining a permit for a fee in excess of $10, plaintiff appeals from a judgment of the Supreme Court, Rockland County, entered January 4, 1980, which, after a nonjury trial, dismissed the complaint. Judgment modified, on the law, by deleting the provision dismissing the complaint and substituting therefor provisions (1) declaring that the fee in question was not excessive and (2) otherwise dismissing the complaint. As so modified, judgment affirmed, with costs payable to the defendants. Orange and Rock-land Utilities brought this action seeking, inter alia, a judgment declaring that the Town of Clarkstown’s $50 street opening permit fee is excessive and an illegal revenue raising measure. Where a permit fee is imposed pursuant to a municipality’s power to regulate, the amount of the fee may not exceed the cost of issuing the permit and of inspecting and regulating the permitted activity (see Matter of Torsoe Bros. Constr. Corp. v Board, of Trustees of Inc. Vil. of Monroe, 49 AD2d 461; Nitkin v Administrator of Health Servs. Admin, of City of N. Y., 91 Misc 2d 478, affd 55 AD2d 566, affd 43 NY2d 673; Mobil Oil Corp. v Town of Huntington, 85 Misc 2d 800). Fees exacted for revenue raising purposes or to offset the cost of general governmental functions are invalid (see id.). The $50 fee imposed by the town for street opening permits is not “clearly disproportionate” to the cost of issuance, inspection and regulation (see Matter of Torsoe Bros. Constr. Corp. v Board of Trustees of Inc. Vil. of Monroe, supra, p 465), or designed to raise revenues or pay for general government costs (id., Nitkin v Administrator of Health Servs. Admin, of City of N.Y., supra). Plaintiff’s evidence demonstrated only that the $50 fee was in excess of the actual cost of processing the permit application. Costs with respect to inspection and regulation must also be considered (id.). Although the town’s inadequate record keeping practices did not provide the court with a cost analysis study with respect to the inspection and regulation of street openings pursuant to permits, the preferred method of determining whether fees are reasonable (see Suffolk County Bldrs. Assn, v County of Suffolk, 46 NY2d 613), the evidence presented clearly demonstrated that these additional costs existed. An “Exact congruence between total expenses and total permit charges” is not required (supra, p 621). Plaintiff thus failed to establish that the fee was excessive. We note, however, that the trial court should have issued a declaration rather than dismiss the complaint in its entirety (see Lanza v Wagner, 11 NY2d 317, 334, app dsmd 371 US 74). Hopkins, J.P., Rabin, Gulotta and Thompson, JJ., concur.