
521 P.2d 1294 (1974)
FOSTER LUMBER COMPANY, INC., a Colorado corporation, Plaintiff-Appellant,
v.
WESTON CONSTRUCTORS, INC., a California corporation, et al., Defendants-Appellees.
No. 73-142.
Colorado Court of Appeals, Div. II.
April 9, 1974.
*1295 David C. Wells, Boulder, for plaintiff-appellant.
Karowsky, Witwer & Oldenburg, Charles A. Karowsky, Greeley, for defendants-appellees Daniel R. Ponton, Darpo Constr.
*1296 Robert N. Miller, Dist. Atty., William G. Arries, Arthur P. Roy, Deputy Dist. Attys., Greeley, for defendant-appellee Walter L. Bain.
Selected for Official Publication.
ENOCH, Judge.
Foster Lumber Company (Foster) appeals from a judgment dismissing both claims in its complaint: The first, a claim for the amount due on a note secured by deed of trust, and the second, an action under C.R.C.P. 106 to compel defendant Bain as public trustee to conduct a foreclosure sale pursuant to the terms of the deed of trust. We affirm the result.
In 1969 Foster conveyed real property to defendant Weston Construction in exchange for a promissory note secured by a first deed of trust on the property. It is alleged that defendants Ponton and Darpo Construction (Darpo) subsequently assumed the obligation represented by the note. Monthly installments due on August 1 and September 1, 1972, were not paid, and on September 8 Foster filed its election and demand for foreclosure with defendant Bain, the public trustee. The sale was set for October 31. At the time Foster filed its election and demand it discovered that, contrary to a covenant in the deed of trust, property taxes for 1971 had not been paid.
In order to cure the default, Darpo, through the public trustee, tendered to Foster on September 29 checks totaling $1,605.28 and receipts for the payment of past due property taxes. Foster refused to accept this tender and insisted that the property be sold by the public trustee. The trustee refused and this suit resulted.
After Foster's Complaint was filed, Bain filed a motion to dismiss for failure to state a claim, and defendants Ponton and Darpo filed motions to dismiss and motions for summary judgment. Weston Construction, the maker of the note, did not enter an appearance in the action. After a hearing on the motions judgment was entered dismissing Foster's complaint as to all defendants.
The issues in this case are governed by 1969 Perm.Supp., C.R.S.1963, 118-9-18, which provides in pertinent part:
"When only default is nonpayment. Whenever the only default or violation in the terms of the note and deed of trust or mortgage being foreclosed is nonpayment of any sum due thereunder, the owner or owners of the property being foreclosed or party or parties liable thereon shall be entitled to cure said particular default if ... the owners or parties pay to the officer conducting the sale all delinquent principal and interest payments which are due as of the date of such payment exclusive of that portion of the principal which would not have been due in the absence of acceleration, plus all costs, expenses, late charges, attorney's fees and other fees incurred by the holder of such note, deed of trust, or mortgage as of the date of payment in connection with such proceedings for collection and foreclosure.... Upon payment of all withdrawal fees and costs plus an additional thirty-five dollars public trustees' costs... all proceedings for foreclosure shall terminate." (emphasis added)
This statute represents a legislative expansion of equitable principles espoused by Justice Cardozo in his dissent in Graf v. Hope Building Corp., 254 N.Y. 1, 171 N.E. 884, and applied by courts to relieve debtors of the strict requirements of timely payments under the terms of a mortgage. See Arizona Coffee Shops, Inc. v. Phoenix Downtown Parking Ass'n, Inc., 95 Ariz. 98, 387 P.2d 801; Rosenthal, The Role of Courts of Equity in Preventing Acceleration Predicated Upon a Mortgagor's Inadvertent Default, 22 Syracuse L.J. 897. Several other states have enacted similar legislation. See, e. g., Cal.Civ.Code § 2924c (West Supp. 1973); Ore.Rev.Stat. § 86.760 (1971).

I.
On appeal, Foster argues that the statute does not apply to a situation where, as here, default in the terms of the note and *1297 deed of trust consists not only of non-payment of principal and interest, but also of failure to pay real property taxes. We do not agree.
The language of the statute does not clearly indicate whether it was intended to apply to non-payment of taxes as well as default in payment of principal and interest. When describing the precise requirements of tender, the statute refers only to "principal and interest payments... costs, expenses, late charges, attorney's fees and other fees incurred by the holder of such note ...." However, the phrase "any sum due thereunder" is susceptible to an interpretation including delinquent taxes. The statute must be interpreted so as to carry out the general legislative intent, which was to permit debtors to prevent foreclosure of mortgages or deeds of trust in instances in which the creditor's interests will not be jeopardized.
If the only default is failure to pay principal and interest, the statute permits a debtor to prevent foreclosure if he is able to pay the amount in default plus expenses incurred by the holder. Upon such payment, the position of the creditor is the same as if the payments had been timely. With respect to overdue taxes, in many instances the creditor can also be made whole by the mere payment of money. See Middlemist v. Mosier, 151 Colo. 113, 377 P.2d 110; Bisno v. Sax, 175 Cal.App.2d 714, 346 P.2d 814. In this case, tax receipts evidencing payment of all taxes due were tendered prior to foreclosure by the public trustee. The lien for unpaid taxes was thereby dissolved and any impairment of the creditor's collateral resulting from overdue taxes vanished. Under these circumstances, we hold that the statute serves as a bar to prevent foreclosure.
Foster cites Motlong v. World Savings & Loan Ass'n, 168 Colo. 540, 452 P.2d 384, for the proposition that non-payment of taxes constitutes an independent default which will support an action for foreclosure. However, the facts in that case are significantly different from the case at hand. In addition to non-payment of taxes, the debtor (Motlong) had permitted the property to deteriorate.
"Motlong was fully aware of the several violations of the covenants in the deed of trust, and apparently made no effort to repair the premises or pay the taxes after he learned of the foreclosure proceedings.... After the sale, he apparently made no attempt to redeem the property."
In the case at hand, there is no allegation that the property had deteriorated. Also, Darpo moved quickly to cure the default in tax payments prior to the date scheduled for the foreclosure sale.

II.
Foster does not challenge the sufficiency of the tender with respect to overdue principal, interest, and other expenses, and we must assume that it was adequate. The public trustee was therefore justified in refusing to conduct the foreclosure sale.
Foster argues that, even if foreclosure is not permitted under the deed of trust, the trial court erred in dismissing its first claim for relief requesting a money judgment on the underlying note. Foster contends that the statute only prevents foreclosure by the public trustee, and does not prohibit suit on the note. The amount sought by Foster in its first claim for relief is the entire amount due on the note pursuant to a clause which permits acceleration upon default.
In Colorado, the holder of a note secured by deed of trust or mortgage has traditionally had the right to sue on the note alone, to foreclose on the property, or to join these proceedings in one action. Foothills Holding Corp. v. Tulsa Rig, Reel & Mfg. Co., 155 Colo. 232, 393 P.2d 749; Greene v. Wilson, 90 Colo. 562, 11 P.2d 225; Folda Real Estate Co. v. Jacobsen, 75 Colo. 16, 223 P. 748. Prior to enactment of the statute permitting cure of default, nothing prevented a creditor, after default, from accelerating payments under the *1298 terms of a note and deed of trust or mortgage, and the choice of remedies did not produce inconsistent results. If the creditor invoked an acceleration clause, the debtor was obligated for the entire amount due, whether the creditor brought foreclosure proceedings or a suit on the note. However, the statute has modified the common law by limiting the right of acceleration. This appeal requires us to determine precisely what those limitations are.
The statute specifically refers to defaults on "the note, deed of trust, or mortgage" and was obviously intended to permit a debtor to cure a default in the terms of either instrument. It is important to note, however, that by its terms, the statute applies only to deeds of trust or mortgages "being foreclosed" and that the statutory mechanism for tender operates through the public trustees or other officers "conducting the sale." Statutory coverage is therefore triggered by initiation of foreclosure proceedings on the mortgage or deed of trust. In this case, when Foster filed its election and demand with the public trustee and the debtor tendered the overdue sums and costs, the statute operated to cure the default.
The crucial issue, then, is whether, once the provisions of the statute have been complied with and the appropriate sums tendered by the debtor, the default is cured only for the purpose of preventing foreclosure, or whether the creditor is also precluded from maintaining an action on the note based on that default. We believe the latter interpretation is correct. Where the creditor has elected to pursue foreclosure on his security, as he did in this case, the statute controls the proceedings, and a statutory tender by the debtor not only precludes foreclosure under the deed of trust but also precludes the creditor from pursuing an independent claim on the note under its acceleration clause, since a necessary element permitting acceleration, namely default, is no longer present.
As we pointed out above, adequate tender under the statute puts the creditor in the same position he would have been in if payments had been timely. From the creditor's point of view, it is as though a default had not occurred since any harm resulting from late payment has been cured.
The construction urged by plaintiff would allow a creditor who has elected to foreclose on the property to achieve indirectly the result prohibited by 1969 Perm. Supp., C.R.S.1963, 118-9-18. Even though tender under the statute had been made, the creditor could obtain a judgment for the full amount of the note and then levy on the real property covered by the deed of trust or any other assets of the debtor. Certainly the legislature did not intend that the statute be circumvented so easily.

III.
Foster further contends that the court erred in granting defendants' motion to dismiss for failure to state a claim because the court went beyond the pleadings and considered other matters. Technically this ruling was erroneous since the court considered affidavits submitted by the parties. A motion to dismiss for failure to state a claim must be decided solely on the basis of allegations stated in the complaint. See Dillinger v. North Sterling Irrigation District, 135 Colo. 100, 308 P.2d 608. However, where such a motion is made and "matters outside the pleadings are presented to and not excluded by the court, the motion shall be treated as one for summary judgment." C.R.C.P. 12(b). The trial court should have treated the motions to dismiss as motions for summary judgment and we treat them as such, particularly as to defendant Bain who filed only a motion to dismiss. As previously noted, the other two defendants did file motions for summary judgment. Since we have determined that the merits were correctly decided in favor of defendants, we need only modify the order of the trial court to provide that summary judgment be entered in favor of all three defendants.
As modified, the judgment is affirmed.
PIERCE and RULAND, JJ., concur.
