
938 P.2d 1368 (1997)
John P. TURNER, Plaintiff and Appellant,
v.
KERIN & ASSOCIATES and Richard T. Kerin, Defendants and Respondents.
No. 96-002.
Supreme Court of Montana.
Argued January 30, 1997.
Submitted March 20, 1997.
Decided June 11, 1997.
*1369 James A. McLean; Drysdale, McLean & Nellen, Bozeman, George A. Guynes (argued), Attorney at Law, Santa Fe, NM, for Plaintiff and Appellant.
Jon M. Hesse (argued), Attorney at Law, Livingston, for Defendants and Respondents.
LEAPHART, Justice.
John P. Turner (Turner) appeals from the Eighteenth Judicial District Court's order dismissing his complaint against the engineering firm of Kerin & Associates and against civil engineer Richard Kerin (jointly referred to as Kerin) for failure to state a claim upon which relief can be granted pursuant to Rule 12(b)(6), M.R.Civ.P. We affirm in part,reverse in part and remand.
We restate the issues on appeal as follows:
1. Did the District Court err in holding that there is no cause of action for impairment of a security interest?
2. Did the District Court err in dismissing Turner's claim for breach of contract?
3. Did the District Court err in dismissing Turner's claim for breach of professional duty?

BACKGROUND
A motion to dismiss under Rule 12(b)(6), M.R.Civ.P., has the effect of admitting all *1370 well-pleaded allegations in the complaint. In considering the motion, the complaint is construed in the light most favorable to the plaintiff, and all allegations of fact contained therein are taken as true. Common Cause of Montana v. Argenbright (1996), 276 Mont. 382, 386, 917 P.2d 425, 427. The allegations in the complaint indicate that Turner holds three mortgages secured by real property (the Property) which was owned by Ameritrust. The three mortgages were held by Sterling Trading, Ltd. Turner, who had a judgment against Sterling Trading, Ltd., executed on two of the mortgages in 1991 and on the third in 1993. In June of 1995, Turner foreclosed his three mortgages on the Property after the Eighteenth Judicial District Court ordered a foreclosure sale. At the foreclosure sale, Turner submitted the highest bid for the property; however, the debt secured by the three mortgages remained unsatisfied as the price bid for the Property was less than the unpaid principal and accrued interest.
Before Turner acquired his security interests in the Property in 1991 and 1993, Ameritrust had, in 1986, contracted with Kerin to perform engineering and supervisory services on the Property for purposes of preparing the Property for subdivision use,including installation of sewer collection and water distribution systems. Kerin completed its work under the 1986 contract well before Turner acquired the mortgages in 1991 and 1993. Kerin's contract with Ameritrust required it to bring the existing approved plans into compliance with standards of the State Department of Health Water Quality Bureau and to take any and all steps which were necessary to certify the installed utilities. A water main had previously been installed on the property. The water main did not meet the AWWA C900 Class Pipe standards and had not been buried at the proper depth. Turner alleged that Kerin knew that the water main pipe was not in compliance and needed to be replaced. Turner alleged that Kerin, nonetheless, replaced the main with new pipe which also failed to comply with AWWA C900 Class Pipe standards. Turner alleged that Kerin, in deviating from the approved plans without having received prior approval of the State of Montana Department of Health, damaged the real property and thereby impaired the value of the property as collateral securing the three mortgages which were subsequently acquired by Turner through foreclosure.
Turner filed this action in District Court raising three claims against Kerin; a claim for impairment of security, a claim for breach of contract, and a claim for breach of professional duty. First, Turner claimed that the water pipe installed by Kerin did not comply with required standards and thus impaired the security interest he subsequently acquired in the Property. Second, Turner claimed that Kerin breached its contract with Ameritrust by failing to bring the modifications into compliance with standards and to obtain certification of the installed utilities. Finally, he alleged that Kerin breached its duty to Ameritrust to exercise due and reasonable care in performing services as a professional engineer. Turner claimed that Ameritrust's claims against Kerin for breach of contract and breach of duty were assets of Ameritrust upon which Turner, as a creditor of Ameritrust, could execute. In response to Turner's complaint, Kerin filed a motion to dismiss claiming that it did not owe a duty to Turner and that since Turner was not an intended beneficiary of the contract, Kerin could not pursue a claim for breach of the contract. The District Court granted Kerin's motion to dismiss for failure to state claims upon which relief could be granted. Turner appeals from the District Court's order.

DISCUSSION
Under Rule 12(b)(6), M.R.Civ.P., a defendant, by motion, may raise the defense that the plaintiff has failed to state a claim upon which relief can be granted. Irving v. Valley Co. Sch. Dist. No. 1-1A (1991), 248 Mont. 460, 464, 813 P.2d 417, 418. Under Rule 12(b), M.R.Civ.P., a complaint shall not be dismissed unless it appears that the plaintiff can not prove a set of facts in support of his *1371 or her claim that entitles her to relief. Proto v. Missoula County (1988), 230 Mont. 351, 353, 749 P.2d 1094, 1095-96. In the instant case, the question is whether Turner can prove a set of facts which would entitle him to relief under any of the claims he asserts in his complaint. Therefore, we will address each of Turner's claims separately.

A. Impairment of Security
In dismissing the complaint, the District Court was unwilling to accept Turner's "impairment of security" theory holding that the relationship between Turner and Kerin was too remote to impose liability for the damage, if any, that Kerin may have inflicted on the Property in 1986 before Turner acquired the three mortgages. The District Court held, "[n]either party has cited authority whereby either the Montana Supreme Court or the Montana legislature has adopted the `impairment of security' theory. Only California has applied the `impairment of security' theory to the acts of construction professionals."
In order to resolve the issues presented in this case, we need to engage in a three-step analysis: First, we must determine whether Montana recognizes a mortgagee's right to state a claim for impairment of security. Secondly, assuming we do recognize a claim for impairment of security, may such a claim be asserted by a mortgagee against a third-party not in possession of the property? Finally, may such a claim be asserted by a mortgagee who purchases mortgages at a foreclosure sale subsequent to the time at which the damage was inflicted on the security?

Does Montana recognize a claim for impairment of security?
Over 100 years ago, this Court first recognized a mortgagee's right to sue a mortgagor for impairment to a security interest in Dutro v. Kennedy (1889), 9 Mont. 101, 22 P. 763. Kennedy, a mortgagor, attached fixtures and caused improvements to be made to the subject property after execution of the mortgage. After the mortgage had been foreclosed and the property sold at a sheriff's sale, the mortgagor attempted to remove the fixtures and improvements. Dutro, 22 P. at 763-64. The mortgagee, Branch, instituted suit against the mortgagors. During the pendency of the litigation, Branch transferred his interests in the suit to Dutro who successfully prosecuted the suit to a final judgment. The Dutro Court held:
Whenever the mortgagor endeavors to remove the fixtures or improvements upon mortgaged property, he may be enjoined, or the credit or may have his choice of an action for damages, or one of claim and delivery, after he has become the purchaser of the property at sheriff's sale, as in the present instance.
Dutro, 22 P. at 764.
In a similar vein, we have held that, on redemption, a mortgagee is accountable to the mortgagor for waste committed by him on the premises while in his possession, including the permanent depreciation in the property caused by failure to make necessary repairs or depreciation resulting from reckless or improvident management of the property. Toole v. Weirick (1909), 39 Mont. 359, 364, 102 P. 590, 593.
Although the Dutro and Weirick decisions do not explicitly draw a distinction between damage to the property as opposed to damage to the security interest, we conclude that these decisions are consistent with the rule that a mortgagee can, before a foreclosure sale, or afterwards if the debt has not been satisfied, bring suit alleging that his security (as distinct from the property itself) has been diminished through the actions(or inactions) of the mortgagor. As the Supreme Court of California recognized in Cornelison v. Kornbluth (1975), 15 Cal.3d 590, 125 Cal.Rptr. 557, 562, 542 P.2d 981, 986, the cause of action for waste evolved in the common law so as to afford protection to concurrent holders of interests in land who were out of possession, e.g. mortgagees, from harm committed by persons who were in possession, e.g. mortgagors. The California court cited the New York decision of Van *1372 Pelt v. McGraw (1850), 4 N.Y. 110, 112, for the proposition that a holder of a mortgage on lands has a cause of action on the case against the mortgagor for acts of waste committed by the latter with knowledge that the value of the security would thereby be injured. Van Pelt set forth the measure of damages:
Now this action is not based upon the assumption that the plaintiff's [mortgagee's] land has been injured, but that his mortgage as security has been impaired. His damages, therefore, would be limited to the amount of injury to the mortgage, however great the injury to the land might be.
Van Pelt, 4 N.Y. at 112.
In W. & R. Inv. Co. v. Edwards Supply Co. (1939), 304 Mass. 650, 24 N.E.2d 518, 519, the Massachusetts court held that a mortgagee of real estate, at least before foreclosure, has a right of action against the mortgagor or any other person who, without license, removes any part of the mortgaged property.
"Whether the mortgagee is in possession of the mortgaged premises or not, or whether his right to possession begins only with the breach of condition and there has been no breach, nevertheless he has such an interest in the property and its preservation as enables him to maintain an action in his own name for injury to it. Such right of action is founded not upon the right to present possession, but on title to the estate. He may maintain such an action,. . . although the security remains ample for his protection. He has a right to his security unimpaired."
W. & R. Inv., 24 N.E.2d at 519 (quoting Delano v. Smith (1910), 206 Mass. 365, 92 N.E. 500, 501). The Massachusetts court held that this right of action is not personal to the mortgagee,"but arises out of and pertains to the estate, and whatever may be recovered is to be applied in payment, pro tanto, of the mortgage debt and thus is ultimately for the benefit of the mortgagor, if he redeems." W. & R. Inv., 24 N.E.2d at 520.
We agree that a mortgagee may state a cause of action against a mortgagor for actions or inactions which damage the collateral and thereby impair the mortgagee's ability to satisfy the secured debt.

Does a mortgagee have a cause of action for impairment of security as against a third-party not in possession?
This Court's decisions in Dutro and Weirick recognize a cause of action against the party in possession for damage or waste to the collateral. We have not, however, addressed whether a mortgagee may bring a cause of action against a third party not in possession for impairment of the security.
Although this Court has not addressed a mortgagee's right to bring an action against a third party for damage to the security interest, other jurisdictions have recognized such a cause of action. The California Supreme Court has held that when a third person tortiously damages the property, both the mortgagor and mortgagee may sue the third party tortfeasor. Cornelison v. Kornbluth (1975), 15 Cal.3d 590, 125 Cal.Rptr. 557, 563 n. 3, 542 P.2d 981, 987 n. 3; American Savings and Loan Ass'n v. Leeds (1968), 68 Cal.2d 611, 68 Cal.Rptr. 453, 456, 440 P.2d 933, 936.
In Mathews v. Silsby Bros. (1924), 198 Iowa 1392, 201 N.W. 94, 94-95, the Iowa Supreme Court recognized that in a "lien state" such as Iowa, although a mortgagee cannot maintain a cause of action for trespass quare clausum fregit, he may maintain a cause of action against the mortgagor or a third party for damages to his security. Montana, like Iowa, is a lien state, State ex rel. Highway Comm. v. District Court (1972), 160 Mont. 35, 499 P.2d 1228; Miller v. Federal Land Bank of Spokane (9th Cir.1978), 587 F.2d 415, cert. denied, 441 U.S. 962, 99 S.Ct. 2407, 60 L.Ed.2d 1067 (1979).
In Sloss-Sheffield Steel & Iron Co. v. Wilkes (1936), 231 Ala. 511, 165 So. 764, 767, the Alabama Supreme Court, citing Mathews, held that, where the mortgage is foreclosed after the damage occurred (as herein), the mortgagee has a right of action against a *1373 third-party for damages to the real property which impairs his security.
When damage occurs before foreclosure, the right of action by the mortgagee whatever it may be, or the nature of the action, is only for the recovery of an amount not exceeding the mortgage debt. The right of action is collateral to the debt, and as security for it. The mortgagee may pursue any course he pleases to collect the debt, whether it be a suit for a personal judgment against the debtor, or for damages against one who has wrongfully converted the mortgaged property, or otherwise destroyed his rights in it, or for a foreclosure. And he may do them all at the same time. But when he once collects his debt, by any one of those proceedings, or by a voluntary payment of it, he cannot pursue any other remedy. They are all but means to accomplish one purpose, and when that is accomplished, all the remedies, not used in so doing, are terminated.
Sloss-Sheffield, 165 So. at 767.
The Fifth Circuit has also held that the damages in a claim against a third party for impairment of security are limited to damages to the ability to collect the debt as opposed to diminution in the value of the property itself. Allstate Finance Corp. v. Zimmerman (5th. Cir.1959), 272 F.2d 323, 325. In Allstate, the plaintiff-mortgagee purchased the property at a foreclosure sale and, since he bid the full amount of the debt, the debt was satisfied and the court held that he could not state a cause of action. Allstate, 272 F.2d at 325-26. Similarly, in the present case, Turner purchased the property at foreclosure. However, he alleged that since the price bid was less than the outstanding debt, the debt remained unsatisfied. Thus, he has stated a cause of action.
In accordance with the above authorities, we hold that a mortgagee can state a cause of action against a third party for damages to real property which impair his or her security interest in that property. A third party who contracts to work on property has a duty to perform his work in such a manner that he does not damage the property or impair the value of the property as collateral for a then-existing security interest.

Can a claim for impairment of security be asserted by one who succeeds to the mortgagee's security interest after the point in time when the damage to the security is alleged to have occurred?
In the case at hand, Turner purchased the mortgages in question in 1991 and 1993,some five to seven years after Kerin had performed the work in question. Thus a question arises as to whether Turner can assert a claim against Kerin since Turner did not hold the security interests in the property at the time Kerin was performing its work on the property. We first note that, although Turner did not acquire the mortgages until 1991 and 1993, the mortgages themselves were in existence in 1986 when Kerin performed the work in question. Turner acquired the mortgages by foreclosing against the predecessor mortgagee, Sterling Trading, Ltd. Our decision in Dutro is instructive on this point. In Dutro v. Kennedy (1889), 9 Mont. 101, 22 P. 763, Branch, the original mortgagee, filed suit against the mortgagors Kennedy and Scheurman, but, during the pendency of the litigation, Branch transferred his interests in the mortgage to Dutro who prosecuted the suit to a final judgment. Thus Dutro, who successfully prosecuted the claim, had no interest in the property at the time the mortgagor damaged the property. Rather, he acquired his interests from Branch, after the fact. Dutro, 22 P. at 764. In a similar vein, we hold that in acquiring these mortgages at foreclosure sale in 1991 and 1993, Turner stands in the shoes of a transferee of the mortgages and has the same rights to pursue a claim for impairment of security that Dutro acquired from Branch. That is, he acquired all the rights and liabilities of the predecessor mortgagee Sterling Trading, Ltd. Like his predecessor Sterling Trading, Ltd., Turner can pursue a claim against a third party who has impaired the ability of the holder of the mortgage to collect the debt secured thereby.
*1374 The District Court, relying on our holding in Jim's Excavating Service v. HKM Assoc. (1994), 265 Mont. 494, 878 P.2d 248, held that Turner could not state a claim for impairment of security because he had not alleged nor could he prove that Kerin "should have foreseen that the particular plaintiff, or an identifiable class of plaintiffs were at risk in relying on the information supplied." Jim's Excavating involved a claim by a third party contractor against a project engineer, HKM, for economic damages. HKM argued that there could be no tort liability to HKM because there was no privity between HKM and the contractor JES; particularly since the negligence complained of (preparation of plans and specifications) occurred before HKM actually knew JES would be part of the project. Jim's Excavating, 878 P.2d at 251. We rejected the contention that HKM could escape liability simply because it did not know JES would receive the bid "when it knew that some contractor would be relying on its plans and specifications." Jim's Excavating, 878 P.2d at 254. We relied upon an example given in William L. Prosser, The Law of Torts, § 93 (4th ed.1971), which bears repeating:
[B]y entering into a contract with A, the defendant may place himself in such a relation toward B that the law will impose upon him an obligation, sounding in tort and not in contract, to act in such a way that B will not be injured. The incidental fact of the existence of the contract with A does not negative the responsibility of the actor when he enters upon a course of affirmative conduct which may be expected to affect the interests of another person.. . .
....
[T]here are situations in which the making of the contract creates a relation between the defendant and the promisee, which is sufficient to impose a tort duty of reasonable care. By the same token, there are situations in which the making of a contract with A may create a relation between the defendant and B, which will create a similar duty toward B, and may result in liability for failure to act....
In applying the above reasoning to the facts before us, we concluded that, although HKM did not actually know JES would receive the bid, it knew that some contractor would be relying on its plans and specifications.
Thus, we hold that a third party contractor may successfully recover for purely economic loss against a project engineer or architect when the design professional knew or should have foreseen that the particular plaintiff for an identifiable class of plaintiffs were at risk in relying on the information supplied.
Jim's Excavating, 878 P.2d at 255.
In the present case, by contracting with the owners to perform engineering work on the property, Kerin placed itself in a relation toward any party who held a security interest in the property that the law imposed upon him an obligation, sounding in tort and not in contract, to act in such a way that the security interest would not be injured. Kerin knew or should have foreseen that if, contrary to his representations, he relaid with pipe not meeting requisite pipe standards, he would diminish the value of the property and thereby impair the value of the property as security. It was foreseeable that failure to lay the proper pipe would damage an identifiable class of plaintiffs; i.e. those who held an interest in the property, both mortgagors and mortgagees. The fact that Kerin could not specifically foresee Turner's entry into the picture does not change the fact that Turner is a member of an identifiable class of plaintiffs, that is, he is a mortgagee by virtue of having purchased mortgages which were in existence at the time of Kerin's work and which, allegedly, have not been satisfied.
In keeping with the reasoning of Jim's Excavating, we hold that a person who, subsequent to the damage to the property, acquires a pre-existing security interest in the property can maintain a cause of action for impairment of that security interest to the extent of the outstanding debt.

B. Breach of Contract
The District Court dismissed Turner's breach of contract claim holding that *1375 there was no privity of contract between Turner and Kerin and that Turner, "at best, could only be considered as a type (or class) of incidental beneficiary to the contract between Defendants and previous owners." The court relied upon our decision in Harman v. MIA Service Contracts (1993), 260 Mont. 67, 72, 858 P.2d 19, 22-23. Turner contends that the District Court misconstrued his second cause of action. He contends that he is not seeking to enforce the contractual obligation as a third party beneficiary, either incidental or intended. Rather, he, as a creditor of Ameritrust, seeks to execute upon Ameritrust's assets, which include any claims (choses in action) that Ameritrust has against Kerin for breach of contract. He relies on our decision in State ex rel. Coffey v. District Court (1925), 74 Mont. 355, 240 P. 667, wherein we held that claims for breach of contractor for tort connected with contract are choses in action, which are personal property subject to execution. Coffey, 240 P. at 669. That proposition is still good law. However, when put in its proper context, it only has application to a judgment creditor. Mr. Coffey had filed a cost bill which "had the effect of the entry of a judgment for $94 in favor of Herman and Coffey and against Albert W. Ogg upon which execution might issue." Coffey, 240 P. at 668-69. The statutory law pertaining to writs of execution, now, as then, provides:
Execution against property of judgment debtor. If the writ be against the property of the judgment debtor, it shall require the sheriff or levying officer to satisfy the judgment, with interest, out of the personal property of such debtor and, if sufficient personal property cannot be found, out of his real property as provided in XX-XX-XXX.
Section 25-13-304, MCA (emphasis added).
Thus, in order to come within the ambit of Coffey and § 25-13-305, MCA, Turner must be a judgment creditor asserting a claim against a judgment debtor. In reviewing Count II of his complaint (Breach of Contract) it is apparent that Turner has not alleged that he has a judgment against Ameritrust. Rather, he alleges that he is "a direct creditor of Ameritrust and is entitled to execute on any asset of Ameritrust." This allegation is not sufficient to state a cause of action. A creditor who has not yet reduced his claim to judgment is not in a position to execute. Although the District Court dismissed Count II for the wrong reasons, the dismissal was correct and is therefore affirmed. See Clark v. Eagle Systems, Inc. (Mont.1996), ___ Mont. ___, 927 P.2d 995, 1000, 53 St.Rep. 1150, 1152.

C. Breach of Professional Duty
In Count III, Turner contends that he is entitled to execute upon Ameritrust's claim that Kerin breached its professional duty to exercise due care as a civil engineer. Applying the same reasoning it used in rejecting the impairment of security claim, the District Court dismissed the claim for lack of foreseeability under the principles enunciated in Jim's Excavating. As with Count II, the District Court has misconstrued the nature of Turner's claim in which he seeks to execute upon a chose in action rather than assert the claim in his own right. However, since Count III, like Count II, does not allege that Turner is a judgment creditor entitled to execute, the same reasoning we set forth with regard to the breach of contract claim pertains. We affirm the District Court's ruling that Count III fails to state a claim upon which relief can be granted.
Accordingly, we affirm the dismissal of Counts II and III and reverse the order dismissing Count I (Impairment of Security) and remand for further proceedings consistent with this opinion.
TURNAGE, C.J., and HUNT, NELSON, REGNIER, GRAY and TRIEWEILER, JJ., concur.
