
192 S.W.3d 890 (2006)
MOONLIGHT INVESTMENTS, LTD., Appellant,
v.
Francis D. JOHN et al, Appellees.
No. 11-05-00155-CV.
Court of Appeals of Texas, Eastland.
May 18, 2006.
Rehearing Overruled June 15, 2006.
*891 William B. Federman, William Todd Ver Weire, Federman & Sherwood, Attorneys At Law, Oklahoma City, OK, Royal Caswell, Attorney At Law, Odessa, for appellant.
Robin C. Gibbs, Brian T. Ross, Gibbs & Bruns, Attorneys At Law, Houston, Harper Estes, Lynch Chappell & Alsup, P.C., Midland, Mark K. Glasser, Penn R. Huston, King & Spaulding, L.L.P., Attorneys At Law, Stephen S. Maris, Stephen M. Dollar, Melissa J. Swindle, Jenkens & Gilchrist, Attorneys At Law, Bruce W. Collins, Lyndon F. Bittle, Todd A. Murray, Carrington, Coleman, Sloman, & Blumenthal, L.L.P., Dallas, for appellees.
Panel consists of: WRIGHT, C.J., and McCALL, J., and McCLOUD, S.J.[*]

OPINION
AUSTIN McCLOUD, Senior Justice.
The issue in this appeal is the propriety of the trial court's dismissal of a shareholder's derivative action based upon the shareholder's failure to make a pre-suit demand. Moonlight Investments, Ltd., a shareholder of a Maryland corporation known as Key Energy Services, Inc., brought this suit on behalf of Key Energy against various board members, officers, and auditors of the corporation.[1] Those sued were Francis D. John, Richard J. Alario, James J. Byerlotzer, Royce W. Mitchell, Kevin P. Collins, W. Phillip Marcum, Ralph S. Michael III, and KPMG LLP. Key Energy was named as a nominal defendant. Key Energy and two other defendants filed motions to dismiss. The trial court granted the motions and ordered that the case be "DISMISSED in its entirety without prejudice." Moonlight appeals. We reverse and remand.
Moonlight presents three issues on appeal. In the first issue, Moonlight contends that the trial court erred in finding that Moonlight failed to sufficiently allege demand futility under Maryland law. In the second and third issues, Moonlight argues that the trial court erred by dismissing the claims without leave to amend and by denying Moonlight's request for leave to amend its petition.
The parties agreed at trial and on appeal that the substantive law of Maryland applies to this case. In Maryland, prior to filing suit on behalf of a corporation, a shareholder is generally required to make a demand upon the corporation's board of directors requesting that the corporation *892 itself bring the suit. Werbowsky v. Collomb, 362 Md. 581, 766 A.2d 123 (2001). Moonlight did not make any such demand upon Key Energy's board. Maryland law does, however, provide for an exception to the demand requirement where such a demand would be futile. Id. at 142-45. The demand futility exception is very limited and may be applied:
[O]nly when the allegations or evidence clearly demonstrate, in a very particular manner, either that (1) a demand, or a delay in awaiting a response to a demand, would cause irreparable harm to the corporation, or (2) a majority of the directors are so personally and directly conflicted or committed to the decision in dispute that they cannot reasonably be expected to respond to a demand in good faith and within the ambit of the business judgment rule.
Id. at 144. Central to the issues in this case is whether, under Maryland law, Moonlight sufficiently alleged demand futility in its pleadings; the merits of the underlying suit are not before us.
The record shows that Moonlight's 45-page First Amended Verified Shareholder Derivative Petition was the live pleading considered by the trial court. In that petition, Moonlight generally alleged breach of fiduciary duty, abuse of control, and other violations of law against the individual defendants. As against KPMG, Moonlight alleged professional negligence, accounting malpractice, and aiding and abetting breach of fiduciary duty.
Moonlight specifically alleged that Key Energy was an onshore, rig-based well servicing contractor with about 1,489 well service rigs and 2,295 oilfield service vehicles. Moonlight alleged that the defendants drafted, ratified, and disseminated false and misleading information regarding Key Energy's financial condition and performance and that they concealed material adverse information. According to the allegations, Key Energy's unaudited quarterly and year-end reports materially overstated its revenues and failed to account for write-downs and the amortization of goodwill. The lack of adequate internal controls caused Key Energy to be unable to ascertain its true financial condition and resulted in a material inflation of its financial position. Key Energy's accounting irregularities violated generally accepted accounting procedures. Key Energy failed to timely file an audited annual report for 2003 as required by the SEC. The 2004 earnings forecast was also withdrawn. As a result of the defendants' actions, Key Energy's credit suffered, its stock value fell, and its status as a publicly traded company on the New York Stock Exchange was jeopardized.
Moonlight further alleged that it was excused from making demand upon Key Energy's board of directors, half of whom were named as individual defendants in Moonlight's petition, because they were "hopelessly conflicted." Moonlight alleged that the four named board members encouraged, sponsored, approved, and actively participated in the wrongful acts and omissions complained of in the petition and that the granting of large stock options to Alario evidenced the board's lack of independence. Moonlight asserted that demand would be futile because a majority of the directors participated in the wrongs alleged in the petition, were beneficiaries of the wrongdoing, and were not disinterested parties. Moonlight also asserted that the directors would be forced to sue themselves and others with whom they have extensive business and personal entanglements and that such a suit would likely expose the directors to further violations of securities laws and civil suits.
Moonlight also asserted that KPMG committed professional negligence and accounting *893 malpractice and failed in its auditing duties to Key Energy by violating the most fundamental requirements of generally accepted auditing standards. KPMG played a pivotal role in the creation of the false and misleading documents filed with the SEC. In its petition, Moonlight set out specific instances in which KPMG allegedly violated standard auditing procedures.
Based upon allegations similar to those against the directors in the present case, the court in Werbowsky held that the shareholder was not excused from making demand because it had not satisfied the requirements for the demand futility exception. See Werbowsky, 766 A.2d at 144-45. Likewise, even though Moonlight alleged that half of Key Energy's directors participated in the wrongdoing, Moonlight's allegations failed to demonstrate that a majority of the directors were so personally and directly conflicted or committed to the decision in dispute that they could not reasonably have been expected to respond to a demand in good faith and within the ambit of the business judgment rule. The first issue is overruled.
Although dismissal would have been the proper remedy in Maryland, the issue still remains whether dismissal was the proper remedy in a Texas court applying Maryland substantive law. This issue is addressed under Moonlight's second issue. Moonlight contends that the proper procedure in Texas should have involved special exceptions and, if meritorious, the granting of leave to amend the petition. The record shows that, in the alternative to their request for dismissal, Mitchell and Byerlotzer specially excepted to Moonlight's petition.
Under Texas procedural law, a party is generally required to file a special exception to challenge a defective pleading.[2] TEX.R. CIV. P. 91 provides that a special exception shall point out the pleading excepted to and, with particularity, the defect or insufficiency in the allegations of the pleading. Upon sustaining a special exception, a trial court must give the pleader an opportunity to amend his pleadings prior to granting summary judgment or dismissing the case. Friesenhahn v. Ryan, 960 S.W.2d 656, 658 (Tex.1998); Massey v. Armco Steel Co., 652 S.W.2d 932, 934 (Tex.1983); Tex. Dep't of Corr. v. Herring, 513 S.W.2d 6, 10 (Tex.1974). In Herring, the court stated:
But only after a party has been given an opportunity to amend after special exceptions have been sustained may the case be dismissed for failure to state a cause of action.
In the instant case Herring was precluded opportunity to amend his pleadings once the trial court had granted the motion for summary judgment. This court believes that the protective features of special exception procedure should not be circumvented by a motion for summary judgment on the pleadings where plaintiff's pleadings, as here, fail to state a cause of action. To do so would revive the general demurrer discarded by Rule 90, Texas Rules of Civil Procedure.
Herring, 513 S.W.2d at 10.
Texas statutory law specifically provides for shareholder derivative proceedings in TEX. BUS. ORG.CODE ANN. §§ 21.551-.563 (Vernon Pamph.2005)(effective Jan. 1, 2006), formerly TEX. BUS. CORP. ACT art. 5.14 (2003). Pursuant to this statute, dismissal of a derivative proceeding is the appropriate remedy when the shareholder *894 fails to file a written demand. See Section 21.553 (requiring demand prior to instituting derivative proceeding); Pace v. Jordan, 999 S.W.2d 615, 621 (Tex.App.-Houston [1st Dist.] 1999, pet. denied)(stating that "the remedy for an inadequate demand is dismissal"). Texas substantive law, however, is not applicable to this case because Key Energy is a foreign corporation. Section 21.562 provides that, where foreign corporations are involved, "the matters covered by this subchapter are governed by the laws of the jurisdiction of incorporation of the foreign corporation, except for Sections 21.555, 21.560, and 21.561, which are procedural provisions and do not relate to the internal affairs of the foreign corporation."[3]
We hold that, although Texas substantive law is not applicable, Texas procedural law is. As a general rule, Texas law governs matters of remedy and procedure in Texas courts even when another jurisdiction's substantive law applies. California v. Copus, 158 Tex. 196, 309 S.W.2d 227, 230 (1958); Creative Thinking Sources, Inc. v. Creative Thinking, Inc., 74 S.W.3d 504, 510 (Tex.App.-Corpus Christi 2002, no pet.); Intevep, S.A. Research and Technological Support Establishment v. Sena, 41 S.W.3d 391, 394 (Tex.App.-Dallas 2001, no pet.). Section 21.562's exclusion of Sections 21.555, 21.560, and 21,561 "procedural provisions" that do not relate to the internal affairs of the foreign corporationindicates that the legislature did not intend to except derivative shareholder proceedings from the general rule that Texas procedural law applies even in cases where a foreign corporation is involved.
The record shows that, upon determining that Moonlight's petition was defective, the trial court did not give Moonlight an opportunity to amend its petition but, instead, promptly dismissed the case. The appropriate procedure in this case would have been to sustain the special exceptions based upon the defective pleadings and to allow Moonlight an opportunity to amend the pleadings. See Rule 91; see also Herring, 513 S.W.2d at 10; Atkinson v. Reid, 625 S.W.2d 64, 66 (Tex.App.-San Antonio 1981, no writ). The defect in the pleadings may have been curable by amendment. Thus, the trial court's dismissal of the case prior to giving Moonlight an opportunity to amend its petition was improper. See Friesenhahn, 960 S.W.2d at 658; Massey, 652 S.W.2d at 934; Herring, 513 S.W.2d at 10; Atkinson, 625 S.W.2d at 66. Because the trial court failed to apply Texas law with respect to the procedure to be followed and the remedy available at that point in the proceeding, we sustain Moonlight's second issue. We also find that the error is reversible because it caused the rendition of an improper judgment. TEX. R.APP. P. 44.1; see Atkinson, 625 S.W.2d at 66.
Pursuant to TEX.R.APP. P. 47.1, we need not address the final issue. With respect to this issue, however, in which Moonlight complains of the trial court's denial of a request for leave to amend the petition, we note that Moonlight did not need leave of court to amend its pleadings. TEX.R. CIV. P. 63.
The judgment of the trial court is reversed, and the cause is remanded for further proceedings.
NOTES
[*]  Austin McCloud, Retired Chief Justice, Court of Appeals, 11th District of Texas at Eastland sitting by assignment.
[1]  Key Energy's principal place of business was Midland County, Texas.
[2]  There are exceptions to this general rule. See, e.g., TEX. CIV. PRAC. & REM.CODE ANN. § 14.003 (Vernon 2002)(dismissal of inmate litigation).
[3]  The three excluded sections are not relevant to this case; they provide for the stay of proceedings during an investigation, the discontinuance or settlement of the proceeding with court approval, and the payment of expenses related to the lawsuit.
