
166 B.R. 901 (1994)
In re Dennis Love RUSSELL and Barbara Jean Russell, Debtors.
Dennis Love RUSSELL and Barbara Jean Russell, Appellants,
v.
FIRST NATIONAL BANK, Appellee.
BAP No. SC-93-2086-SRO, Bankruptcy No. 92-07049-A11. Adv. No. 93-90335-A11.
United States Bankruptcy Appellate Panel of the Ninth Circuit.
Argued and Submitted March 24, 1994.
Decided May 11, 1994.
*902 John S. Huiskamp, San Diego, CA, for appellants.
Sharon L. Rhodes, San Diego, CA, for appellee.
Before: SULLIVAN[1], RUSSELL and OLLASON, Bankruptcy JJ.

OPINION
SULLIVAN, Bankruptcy Judge:
The debtors sued First National Bank ("FNB") alleging that FNB discriminated against them because the debtors are black. The debtors sought damages for violation of their civil rights. The bankruptcy court dismissed the complaint with prejudice based on res judicata principles. The debtors appeal. We REVERSE AND REMAND.

I. FACTS
Dennis Russell owned a concrete contracting company called Den-Ed Russell, Inc. ("Den-Ed"). In 1985, FNB provided a line of credit for Den-Ed. By 1987, the line of credit had increased to $1,000,000. The Bank also loaned money to Dennis and Barbara Russell ("Russells") individually, and obtained their personal guaranty of the corporate debt. The loans had cross default provisions and were secured by four separate parcels of real property, some owned by Den-Ed and some by the Dennis L. Russell and Barbara J. Russell Trust ("Trust"). The real property included the business location of Den-Ed and the Russells' home.
On February 28, 1992, FNB filed a complaint against Den-Ed, the Russells, the Trust, and Sea Pacific Corp. for default on the promissory notes, breach of guaranties and foreclosure of the collateral. FNB requested and obtained the appointment of a receiver. On June 12, 1992, Den-Ed and the Russells filed Chapter 11[2] petitions.
*903 On July 20, 1992, FNB filed motions for relief from the stay to proceed with the state court foreclosure suit. Several months later, the bankruptcy court granted relief from the stay without limitation in the Den-Ed Chapter 11, and granted limited relief from the stay in the Russells' case. The order entered on February 18, 1993 which granted relief from the stay in the Russells' case was submitted by FNB's counsel, and provided:
FNB is hereby granted relief from the automatic stay to proceed with its state court litigation matter (San Diego County Superior Court Case No. 649013, and In the Circuit Court of the Second Circuit State of Hawaii Civil Case No. 92-1064-03) (collectively the "state court litigation") against these debtors and this estate and to judicially foreclose in accordance with state law on its collateral and on all interests in that collateral held or claimed by these debtors and this estate. The state court litigation proceedings against the debtors and this estate may proceed through the judicial sale of the applicable collateral, but thereafter the automatic stay shall be in effect as to further proceedings against the debtors and this estate.
On February 26, 1993, a stipulated judgment was entered in the San Diego Superior Court action. The judgment recited the language quoted above from the order granting relief from the stay, followed by:
Accordingly, this judgment shall not be entered as a judgment against (the Russells), and the court shall retain jurisdiction of the claims asserted against them for further proceedings in the event they become no longer entitled to the protection of the automatic stay.
The stipulated judgment further provided that:
6. As a result of the limitations in the order granting relief from the automatic stay as to Dennis L. Russell and Barbara J. Russell, individually, this judgment does not address their personal liability for the indebtedness reflected by the notes identified above, nor does it address the deficiency, if any. The court shall retain jurisdiction to determine the liability of Dennis L. Russell and Barbara J. Russell, and to determine the amount of a deficiency for which they may be liable, in the event they lose the protection of the automatic stay in bankruptcy.
7. Defendants Den-Ed Russell, Inc., Sea Pacific Corp. and the Russell Trust are personally liable, jointly and severally, for payment of the sums secured by the deed of trust for the Viva Court Property and the mortgage for the Hawaii Property. Each of them is a defendant against whom a deficiency judgment may be ordered. The court shall retain jurisdiction to determine the amount of the deficiency, if any, and to render a money judgment on proper application therefor in accordance with Code of Civil Procedure Section 726 . . . (emphasis added).
An amended judgment was entered in the Superior Court on June 8, 1993 to address the bankruptcy petition filed by Sea Pacific Corp.
On March 31, 1993, the Russells filed an adversary proceeding in the bankruptcy court seeking damages from FNB. The complaint alleged that after five years of a good lending relationship, FNB assigned a new vice president to administer their loans and that she hated blacks. They assert that she formulated a plan to call their loans on short notice, prevent them from refinancing the loans, and foreclose against the collateral so they would lose their home and business. The Russells claim that her scheme to foreclose proceeded shortly after they had personally guaranteed the corporate debt and pledged their home as collateral. They sought damages of $10,000,000.
FNB filed a motion to dismiss the complaint on July 2, 1993. The motion was argued on August 5, 1993. The bankruptcy judge recited her oral findings at the conclusion of the hearing and signed an order granting the motion to dismiss with prejudice on August 23, 1993. The dismissal was allowed on the basis that the debtors were precluded from raising the civil rights claim due to the stipulated judgment in state court by the entities they controlled. The judge relied on the case of Scoggin v. Schrunk, 522 F.2d 436 (9th Cir.1975), cert. denied, 423 U.S. 1066, 96 S.Ct. 807, 46 L.Ed.2d 657 (1976). She concluded that because the civil rights *904 action could have been raised as a defense to the foreclosure action, the Russells were precluded from bringing another lawsuit after judgment was entered in the state court. The judge reasoned that the factual and legal determination made within the state court judgment included a determination that the foreclosure was proper and could proceed. The court further stated that any judgment in the civil rights suit would attempt to overturn the earlier findings by saying that the foreclosure should not have gone forward because it was motivated by racial hatred.
The bankruptcy court determined that the Russells were bound by the legal effects of the state court judgment despite the term excluding them from the judgment because they controlled the Trust and Den-Ed who were bound by the judgment.
The order granting the motion to dismiss action with prejudice was entered August 24, 1993[3]. The Russells filed their notice of appeal of the order on August 24, 1993.

II. ISSUES
A. Whether the debtors are precluded from pursuing their civil rights claim against FNB because a stipulated judgment entered in state court against the entities they controlled did not address the civil rights claim.
B. Whether the debtors are precluded from claiming FNB's actions violated their civil rights when entities they controlled stipulated that the entities were liable for the amount due on promissory notes and that FNB could proceed to foreclose against its collateral, but the debtors' liability was specifically excluded from the judgment.

III. STANDARD OF REVIEW
A dismissal for failure to state a claim pursuant to Fed.R.Civ.P. 12(b)(6) is a ruling on a question of law which is reviewed de novo. Oscar v. University Students Cooperative Ass'n, 965 F.2d 783, 785 (9th Cir.) (en banc), cert. denied, ___ U.S. ___, 113 S.Ct. 655, 121 L.Ed.2d 581 (1992). Although matters outside the pleading were presented to and not excluded by the court, a court may properly look beyond the complaint to matters of public record and doing so does not convert a Fed.R.Civ.P. 12(b)(6) motion to one for summary judgment. Mack v. South Bay Beer Distributors, Inc., 798 F.2d 1279, 1282 (9th Cir.1986). A bankruptcy court's ruling on the applicability of res judicata is reviewed de novo. Robi v. Five Platters, Inc., 838 F.2d 318, 321 (9th Cir.1988). The preclusive effect of a judgment in an earlier case presents a mixed question of law and fact in which the legal issues predominate. Id.

IV. DISCUSSION
The complaint dismissed by the bankruptcy court was framed as a damage action under 42 U.S.C. § 1981. The facts alleged claim that FNB's vice president required the personal guaranties and collateral and then collected the loans in a manner intended to harm the Russells because of their race. The guaranties and collateral at issue secured the same loans that were involved in the state court lawsuit. Therefore, the civil rights suit was a cause of action related to the state court complaint and would be a compulsory cross-complaint to the collection of the note under Cal.Code of Civ.Proc. 426 (West 1973).
A party can be compelled to raise a tort claim in defense of a related contract suit. Sylvester v. Soulsburg, 60 Cal.Rptr. 218, 223, 252 Cal.App.2d 185 (Cal.App.1967); Chavez v. Carter, 64 Cal.Rptr. 350, 354, 256 Cal.App.2d 577 (Cal.App.1967). Failure to raise a related cause of action in a cross-complaint will prevent that person from asserting that related claim in a subsequent suit. Cal.Code of Civ.Proc. 426, Crocker Nat. Bank v. Emerald, 270 Cal.Rptr. 699, 705, 221 Cal.App.3d 852 (Cal.App.1990).
Had the final judgment in the state court case been entered against the Russells, they would have been precluded from filing the civil rights suit. However, the language of the judgment explicitly excludes the Russells. By its own terms, the judgment does not "address their personal liability for the indebtedness reflected by the notes identified *905 above, nor does it address the deficiency, if any."
The parties to a judgment can agree that it will not have a preclusive effect on a separate lawsuit. Manning v. Wymer, 78 Cal.Rptr. 600, 605, 273 Cal.App.2d 519 (Cal. App.1969). Although the debtors could have been more precise in reserving their cross-claim against FNB, the judgment is clear that it does not determine the debtors' liability on the underlying notes. FNB provides no factual support to find that the debtors did not intend to preserve all defenses to their liability on the notes, including cross-claims. Because the state court judgment did not determine the Russells' obligation on the debt, there was no final judgment against them, and Scoggin v. Schrunk does not control the outcome of this case.
It does not appear from the record that the Russells or the other defendants had raised the civil rights cross-claim in the state court. The California court is required to grant a party acting in good faith leave to amend a pleading to assert a cause at any time during the course of the action. Cal. Code of Civ.Proc. 426.50 (West 1973). The section is to be liberally construed to avoid forfeiture of causes of action. Since the action against the Russells was subject to the automatic stay, they had little incentive to seek leave to assert the cross-complaint in the state court.
FNB claims that the Russells' control over Den-Ed and the Trust was sufficient privity to bind them to all effects of the state court judgment. The Russells respond that the civil rights action was personal to them, so the corporation could not assert it as a defense. Alternatively, they rely on the language of the judgment which excludes them.
A corporation may have standing to assert a civil rights claim under 42 U.S.C. § 1981. Great American Tool and Mfg. Co. v. Adolph Coors Co. Inc., 780 F.Supp. 1354, 1356 (D.Colo.1992); Rosales v. AT & T Information Systems Inc., 702 F.Supp. 1489, 1494 (D.Colo.1988). Therefore, the Russells' argument that the civil rights claim was solely their own is not persuasive.
Even if Den-Ed or the Trust had standing to bring the civil rights suit, there may be many reasons why they did not. By the time relief from the stay was granted, Den-Ed could have been a defunct business, and it may not have been worth the effort to litigate on behalf of Den-Ed or the Trust. Issue preclusion under such circumstances would be unfair. Restatement (Second) of Judgments § 28(5) (1982). The Russells' failure to pursue the civil rights claim on behalf of the Trust and Den-Ed should not act as a bar to the Russells in this case. The doctrine of privity should not be applied to a person who was a party to the prior litigation when they are specifically excluded from the judgment. The cases cited by FNB do not contain similar fact circumstances.
Neither side presented affidavits on any of the factual issues that may be involved in this matter. They relied on the various documents filed in the state court and the bankruptcy court. There is no information about when the Russells learned of the actions included in the complaint or any prejudice that FNB suffered as a result of the stipulated judgment.
The complaint frames the discrimination as being directed towards the Russells. At this stage of the proceeding, the allegations of the complaint must be taken as true. The harm to the debtors could be great if they forfeit a cause of action under these circumstances. The language of the state court judgment excluding the debtors is sufficient to prevent such a forfeiture.

V. CONCLUSION
The Russells are not precluded by the state court judgment from pursuing their civil rights claim against FNB because their personal liability was specifically excluded from the terms of that judgment. The exclusion of the liability prevents the application of res judicata to the defenses and cross claims the debtors could assert in the determination of their liability. The order dismissing the complaint with prejudice is REVERSED, and this matter is REMANDED to the bankruptcy court.
NOTES
[1]  Honorable Donal D. Sullivan, Chief Bankruptcy Judge for the District of Oregon, sitting by designation.
[2]  Unless otherwise indicated, all Chapter, Section and Rule references are to the Bankruptcy Code, 11 U.S.C. §§ 101 et seq. and to the Federal Rules of Bankruptcy Procedure, Rules 1001 et seq.
[3]  The order includes findings, and appears to violate the requirement of Rule 9021 that the judgment be set forth on a separate document. However, neither party has raised this issue, so the separate entry required is deemed waived by the parties' actions, and this memorandum addresses the merits of the dismissal. Bankers Trust Co. v. Mallis, 435 U.S. 381, 98 S.Ct. 1117, 55 L.Ed.2d 357, reh'g denied, 436 U.S. 915, 98 S.Ct. 2259, 56 L.Ed.2d 416 (1978).
