#### Jay Sandon COOPER, Plaintiff-Appellant v. BANK OF NEW YORK MELLON, Trustee; Ocwen Loan Servicing, L.L.C.; John M. Lynch; J. Garth Fennegan; Kristina A. Kiik; Michael R. Steinmark; Settle & Pou Professional Corporation; David Garvin; Jack Beckman; Kelly Goddard; Gene Alyea; Don Gwin; David O’Dens; Robert Pou; Cliff A. Wade; Michael P. Menton; Jared T. S. Pace, Substitute Trustees, Defendants-Appellees

No. 16-11413 Summary Calendar

United States Court of Appeals, Fifth Circuit.

Filed February 28, 2018

Jay Sandon Cooper, Pro Se

David Michael O’Dens, Esq., Michael Robert Steinmark, SettlePou, Dallas, TX, for Defendants-Appellees

Before DAVIS, JONES, and OWEN, Circuit Judges.

PER CURIAM: *

Jay Sandon Cooper moves to proceed in forma pauperis (IFP) on appeal. He seeks to challenge the district court’s dismissal of his civil action as barred by res judicata. The district court denied his motion for leave to proceed IFP on appeal and certified that the appeal was not taken in good faith. By moving for IFP status, Cooper is challenging the district court’s certification. *See Baugh v. Taylor,*117 F.3d 197, 202 (5th Cir. 1997).

This court reviews de novo a dismissal for failure to state a claim under Rule 12(b)(6). *See Legate v. Livingston,*822 F.3d 207, 209-10 (5th Cir.), *cert. denied sub nom. Legate v. Collier,*— U.S. —, 137 S.Ct. 489, 196 L.Ed.2d 389 (2016). A complaint fails to state a claim upon which relief may be granted when it does not contain “sufficient factual matter, accepted as true, to state a claim to relief that is plausible on its face.” *Ashcroft v. Iqbal,*556 U.S. 662, 678, 129 S.Ct. 1937, 173 L.Ed.2d 868 (2009) (internal quotation marks and citation omitted).

On appeal, Cooper contends that the defendants waived the affirmative defense of res judicata by not raising it in their first motion to dismiss. Although a defendant should generally raise res judicata in an answer, the defense will not be deemed to have been waived as long as it was asserted “at a pragmatically sufficient time,” and the opposing party was not prejudiced in its ability to respond. *United States v. Shanbaum,*10 F.3d 305, 312 (5th Cir.1994). Because the defendants raised the defense in their motion to dismiss after being directed to argue the issue by the magistrate judge, and Cooper was not prejudiced in his ability to respond, they did not waive the res judicata defense. *See id.; see also Pasco ex rel. Pasco v. Knoblauch,*566 F.3d 572, 578 (5th Cir. 2009); *Lafreniere Park Foundation v. Broussard,*221 F.3d 804, 808 (5th Cir. 2000).

Cooper next contends that the district court did not consider the claims he raised *369in his amended complaint that were not barred by res judicata. Contrary to Cooper’s argument, the record reflects that the district court considered Cooper’s amended complaint and compared it to the claims raised in his 2009 and 2013 lawsuits.

Next, Cooper argues that the district court improperly shifted the burden to him by ordering him to produce the records in the prior cases. The district court did not shift the burden of proof to Cooper by directing both parties to present the records of the prior lawsuits. Because both parties referred to the related cases, the district court had the authority to raise the issue sua sponte in the interest of judicial economy where the previous action was brought before a court in the same district. *See Mowbray v. Cameron County, Tex.,*274 F.3d 269, 281 (5th Cir. 2001) (citing *Boone v. Kurtz,*617 F.2d 435, 436 (5th Cir. 1980)); *Nagle v. Lee,*807 F.2d 435, 438 (5th Cir. 1987). The defendants established that in his 2009 and 2013 lawsuits, Cooper raised numerous claims, challenging the pending foreclosure of his property by the same Lender defendants. Courts of competent jurisdiction dismissed both of these lawsuits with prejudice. Further, all of the defendants in the instant cases were in privity with the defendants in the prior lawsuits. All of Cooper’s claims in the prior lawsuits and in the instant lawsuit arose out of his failure to meet his loan obligations and his desire to prevent the Lender defendants from foreclosing on the same property. Therefore, the defendants established that Cooper’s current claims were barred by res judicata. *See Amstadt v. U.S. Brass Corp.,*919 S.W.2d 644, 652 (Tex. 1996); *Samuel v. Fed. Home Loan Mortg. Corp.,*434 S.W.3d 230, 234 (5th Cir. 2014).

According to Cooper, the district court improperly dismissed his complaint with prejudice without a trial on the merits. Contrary to Cooper’s argument, the district court’s dismissal of his complaint for failure to state a claim under Rule 12(b)(6) constitutes a judgment on the merits. *See Federated Dep’t Stores, Inc. v. Moitie,*452 U.S. 394, 399 n.3, 101 S.Ct. 2424, 69 L.Ed.2d 103 (1981); *see also Plant v. Spendthrift Farm,*514 U.S. 211, 228, 115 S.Ct. 1447, 131 L.Ed.2d 328 (1995). The district court did not err in dismissing Cooper’s complaint with prejudice for failure to state a claim under Rule 12(b)(6). *See Iqbal,*556 U.S. at 678, 129 S.Ct. 1937; *Legate,*822 F.3d at 209-10.

Next, Cooper argues that the district court violated Cooper’s due process rights by dismissing the case based on res judica-ta. Cooper’s statute of limitations claim could have been raised in his 2009 lawsuit, which was still pending in June 2010, when the limitations period allegedly expired, as well as in his 2013 lawsuit. Because Cooper could have raised the limitations claim in his prior lawsuits, he has not shown that his due process rights were violated because the district court dismissed this claim as barred by res judicata. *See Amstadt,*919 S.W.2d at 652; *see also Samuel,*434 S.W.3d at 234.

Finally, Cooper contends that the district court erred in not applying state law concerning the doctrine of res judicata. Because he did not raise this argument in his objections to the magistrate judge’s report in the district court, review is limited to plain error. *See Puckett v. United States,*556 U.S. 129, 135, 129 S.Ct. 1423, 173 L.Ed.2d 266 (2009). Although Cooper is correct that the district court erred in not applying state law on res judicata, he has not shown that this error affected his substantial rights because federal and Texas law on res judicata are the same. *See Amstadt,*919 S.W.2d at 652; *Test Masters Educ. Servs., Inc. v. Singh,*428 F.3d 559, 571 (5th Cir. 2005); *Flippin v. Wilson**370*State Bank,*780 S.W.2d 457, 459 (Tex. App. 1989). Because Cooper has not argued or shown that under Texas law, the doctrine of res judicata would have been inapplicable to the instant case, he has not shown that the district court’s failure to apply Texas law affected his substantial rights. *See Puckett,*556 U.S. at 135, 129 S.Ct. 1423.

Cooper’s appeal is not taken in good faith because it lacks arguable merit and is frivolous. *See Howard v. King,*707 F.2d 215, 220 (5th Cir. 1983). Accordingly, Cooper’s IFP motion is DENIED and his appeal is DISMISSED as frivolous. *See Baugh,*117 F.3d at 202 *&*n.24; 5th Cir. R. 42.2.

Cooper has had several prior actions or appeals dismissed as frivolous or for failure to state a claim. *See Cooper v. Dallas Police Ass’n,*584 Fed.Appx. 208 (5th Cir. 2014) (appeal dismissed as frivolous); *Cooper v. Bank of New York,*No. 3:13-CV-1985, 2013 WL 12129248 (N.D. Tex. Jan. 31, 2014) (dismissal for failure to state a claim); *Cooper v. City of Plano,*No. 4:10-CV-00689 (E.D. Tex. Sept. 13, 2011) (dismissal for failure to state a claim); *Cooper v. Household Financial Services,*No. 4:01-CV-00260 (E.D. Tex. April 1, 2002) (dismissal for failure to state a claim). Cooper is ADVISED that future frivolous actions or appeals could result in the imposition of sanctions.

*

 Pursuant to 5th Cir. R. 47.5, the court has determined that this opinion should not be published and is not precedent except under the limited circumstances set forth in 5th Cir. R. 47.5.4.