*883In a hybrid proceeding pursuant to CPLR article 78 in the nature of mandamus, inter alia, to compel the Westchester County Executive to comply with Local Law No. 6 (2012) of the County of Westchester and action for declaratory relief, the respondents/defendants appeal (1) from an order of the Supreme Court, Westchester County (Warhit, J.), dated April 11, 2012, (2), as limited by their brief, from so much of an order of the same court entered October 19, 2012, as directed them either to join the Westchester County Board of Legislators as a necessary party or withdraw each and every defense implicating the Westchester County Board of Legislators as a necessary party, (3) from an order of the same court entered November 14, 2012, which denied their motion pursuant to CPLR 3211 (a) to dismiss the amended petition/complaint, and (4) from a judgment of the same court entered February 25, 2013, which, upon the orders, declared that the respondents/defendants are required to comply with Local Law No. 6 (2012) of the County of Westchester and directed them to implement, enforce, and comply with that local law.
Ordered that the appeals from the orders are dismissed, without costs or disbursements; and it is further,
Ordered that the judgment is reversed, on the law and in the exercise of discretion, without costs or disbursements, the Westchester County Board of Legislators is joined as a respondent/ defendant, without prejudice to the right of the Westchester County Board of Legislators to assert any defenses and affirmative defenses, the order entered October 19, 2012, is vacated, the respondents/defendants’ motion pursuant to CPLR 3211 (a) to dismiss the amended petition/complaint is denied as premature, the order entered November 14, 2012, is modified accordingly; and the matter is remitted to the Supreme Court, Westchester County, for further proceedings consistent herewith; and it is further,
Ordered that the petitioners/plaintiffs are directed, within 30 days after service upon them of a copy of this decision and order, to serve the Westchester County Board of Legislators with a copy of the order to show cause, the amended petition/complaint, the respondents/defendants’ notice of motion to dismiss the amended petition/complaint, and all supporting papers, without prejudice to the right of the Westchester County Board of Legislators to assert any defenses and affirmative defenses.
The appeals from the intermediate orders entered April 11, 2012, October 19, 2012, and November 14, 2012, must be dismissed because the right of direct appeal therefrom termi*884nated with the entry of the judgment in the action (see Matter of Aho, 39 NY2d 241, 248 [1976]). Additionally, the appeal from the intermediate order dated April 11, 2012, must be dismissed because the respondents/defendants are not aggrieved by that order (see CPLR 5511). The issues raised on the appeals from the intermediate orders entered October 19, 2012, and November 14, 2012, are brought up for review and have been considered on the appeal from the judgment (see CPLR 5501 [a] [1]).
The petitioners/plaintiffs (hereinafter the plaintiffs), as members of the Westchester County Board of Legislators (hereinafter the Board), commenced the instant hybrid proceeding and action, inter alia, to compel the respondents/defendants (hereinafter the defendants), including the Westchester County Executive, to comply with Local Law No. 6 (2012) of the County of Westchester (hereinafter the local law). After the Supreme Court denied the plaintiffs’ motion for a preliminary injunction, among other things, compelling the defendants to comply with the local law, the defendants moved to dismiss the amended petition/complaint pursuant to CPLR 3211 (a) on the ground, inter alia, that the local law had not been properly enacted.
In an order entered October 19, 2012, the Supreme Court directed the defendants to either make an application to join the Board as a necessary party, or withdraw each and every defense that “implicate[d] the Board of Legislators as a necessary party.” The defendants failed to make such an application and, consequently, in an order entered November 14, 2012, the Supreme Court denied the defendants’ motion to dismiss the amended petition/complaint.
Thereafter, the defendants served and filed an answer dated December 6, 2012, asserting, as an affirmative defense, the invalidity of the enactment of the local law. In a judgment entered February 25, 2013, the Supreme Court, inter alia, granted that branch of the petition which was to compel the Westchester County Executive to comply with the local law.
A challenge to the procedures by which local legislation is enacted should be raised in a CPLR article 78 proceeding against the body which enacted it (see Matter of Eadie v Town Bd. of Town of N. Greenbush, 7 NY3d 306 [2006]; Matter of Save the Pine Bush v City of Albany, 70 NY2d 193, 202 [1987]). In view of the defendants’ challenge to the validity of the procedures by which the local law was enacted, the Board, as the body that enacted the local law, was a necessary party (see CPLR 1001 [a]; Matter of Stoffer v Department of Pub. Safety of the Town of Huntington, 77 AD3d 305, 318 [2010]). However, it appears that there are legal impediments to the defendants’ commencement *885of an action or proceeding against the Board without the Board’s consent (see Westchester County Charter § 158.11 [3]). Under these circumstances, in the interest of fairness and judicial economy, we join the Board as a necessary party (see Matter of White v County of Sullivan, 101 AD3d 1552, 1553 [2012]; Matter of Mega Sound & Light, LLC v Commissioner of Labor, 99 AD3d 800 [2012]; Matter of Romeo v New York State Dept. of Educ., 41 AD3d 1102 [2007]), and direct the plaintiffs to effect service of process upon the Board, and serve the Board with all appropriate papers.
Although a proceeding pursuant to CPLR article 78 challenging the procedure used to enact local legislation is governed by a four-month statute of limitations, which runs from the enactment of the legislation (see CPLR 217; Matter of Eadie v Town Bd. of Town of N. Greenbush, 7 NY3d 306 [2006]; P & N Tiffany Props., Inc. v Village of Tuckahoe, 33 AD3d 61, 65-66 [2006]), the statute of limitations is a defense which must be asserted by the party opposing the challenge, and the failure to interpose a cause of action within the applicable limitations period is not a jurisdictional defect (see Windy Ridge Farm v Assessor of Town of Shandaken, 11 NY3d 725, 727 [2008]). If the necessary party, once joined, correctly alleges that the statute of limitations bars the proceeding, the proceeding may be then dismissed as time-barred (see id. at 727). Since the Board had yet to be joined when the judgment was entered, the issue of the validity of the enactment of the local law was not properly before the Supreme Court.
In view of the foregoing, we must, inter alia, reverse the judgment and remit the matter to the Supreme Court, Westchester County, for the joinder of the Board in accordance herewith, subject to the Board’s right to assert any defenses or affirmative defenses. Roman, J.P., Sgroi, Miller and Hinds-Radix, JJ., concur.