
450 S.E.2d 101 (1994)
MADDUX SUPPLY COMPANY, INC., Appellant,
v.
SAFHI, INC. and Palmetto Electric Service, Inc., Respondents.
No. 2231.
Court of Appeals of South Carolina.
Heard September 8, 1994.
Decided October 3, 1994.
*102 D. Carlyle Rogers, Jr., and Gregg Meyers, both of Wise & Cole, Charleston, for appellant.
Dunn D. Hollingsworth and Claron A. Robertson, III, both of Robertson & Seekings, Charleston, for respondents.
CURETON, Judge:
Maddux Supply Company, Inc., a construction materials supplier, brought this action to foreclose a mechanic's lien filed in connection with the construction of the Hampton Inn in Mount Pleasant, South Carolina (the "Project"). Maddux sought to foreclose its lien against the owner of the Project, Safhi, Inc., and collect amounts it contends are owed for materials supplied to a subcontractor on the Project, Palmetto Electric Service, Inc. The master-in-equity determined that Maddux was paid in full for the materials it supplied to the Project. The master entered judgment against Maddux and ordered it to pay attorney fees to the general contractor for the Project, Benchmark Construction Company, Inc., which had bonded off the lien against Safhi's property.[1] Maddux appeals. We affirm.
A proceeding to enforce a mechanics' lien is an action at law. Raines v. Sanders, 134 S.C. 284, 132 S.E. 581 (1926). Since this law case was tried by the master without a jury, we are precluded from disturbing his findings of fact unless they are wholly unsupported by the evidence or controlled by an erroneous conception or application of the law. Sentry Eng'g & Constr., Inc. v. Mariner's Cay Dev. Corp., 287 S.C. 346, 338 S.E.2d 631 (1985).
On August 27, 1990, Safhi entered into a construction contract with Benchmark in which Benchmark agreed to act as general contractor in connection with the construction of the Project. On October 26, 1990 Benchmark entered into a subcontract with Palmetto wherein Palmetto agreed to furnish and install a complete electrical system at the Project. Maddux supplied electrical materials to Palmetto for use in the Project.
When Palmetto entered into the subcontract, it already owed Maddux approximately $125,000 for electrical materials provided to it on an open account in connection with other, unrelated construction projects. Although Palmetto had 14 different jobs for which Maddux supplied materials on credit, it had only one open account with Maddux. Between December of 1990 and June of 1991, Palmetto received approximately $83,000 worth of materials from Maddux for use in the Project. Maddux acknowledges it was paid approximately $17,000 for these materials, but asserts that it is owed the remaining $66,000 balance. Safhi, on the other hand, maintains it paid Benchmark who, in turn, paid Palmetto for all materials furnished to the Project. Safhi contends Maddux improperly credited payments from Palmetto to prior or other debts owed by Palmetto to Maddux rather than for the benefit of Safhi.
From December of 1990 to June of 1991, Palmetto submitted monthly pay applications to Benchmark with attached invoices for materials received from Maddux for use at the Project. Upon approval of the pay applications and after withholding retainage as provided for in the subcontract, Benchmark issued a check to Palmetto for services and materials provided. Pursuant to this process, Benchmark wrote 7 checks to Palmetto totalling $189,977.
*103 During the same time period, Palmetto wrote 6 checks to Maddux totalling $165,466. None of these checks included a written designation that the funds should be applied to invoices for materials used at the Project. However, trial testimony indicated and the master concluded that Maddux refused to allow Palmetto to designate its payment toward the invoices for materials supplied by Maddux for the Project. Furthermore, the master found that on several occasions Maddux was informed that the source of the funds Palmetto expected to receive was in connection with this particular project.
The master concluded that Maddux was charged with knowing that funds it received from Palmetto must necessarily have come from Benchmark in payment for materials furnished to the Project. Accordingly, the master held that Maddux was paid in full for the materials it provided to Palmetto for use at the Project, and Maddux was, therefore, not entitled to recover against the bond pursuant to its mechanics' lien. The master also determined that by filing the bond, Benchmark assumed Safhi's position in the case and, therefore, Safhi was entitled, pursuant to S.C.Code Ann. § 29-5-20 (Supp.1993), to an award of $21,540 for the costs and attorney fees Benchmark incurred in defending the foreclosure action on behalf of Safhi.

I.
On appeal, Maddux contends the master erred in holding it was charged with knowing the source of Palmetto's payments. In support of this contention, Maddux asserts it is "undisputed" that Maddux visited and received information about Palmetto's accounts for the first time after the mechanics' lien was filed in June, 1991, and that Maddux's corporate financial manager, Steve Gallimore, testified he did not know the source of Palmetto's funds.
Contrary to Maddux's assertion, Palmetto's bookkeeper, Barbara Dennis, testified she gave information to Gallimore on several occasions between January and June 1991 about the source of the funds Palmetto expected to receive, the dollar amount of the payments expected from Benchmark, and the approximate time when those payments were expected. Dennis also testified that at some point she asked if she could designate Palmetto's payments to Maddux toward the invoices for the materials used at the Project, but Maddux refused and, instead, applied the payments made with Benchmark funds toward Palmetto's prior outstanding balance.
Ordinarily, a creditor must apply payments as instructed by the debtor, but absent a written designation or instructions from the debtor, the creditor may apply payments in its own discretion. Wardlaw v. Troy Oil Mill, 74 S.C. 368, 54 S.E. 658 (1906); American Oil Co. v. Brown Paving Co., 298 F.Supp. 528 (D.S.C.1969). The right of a creditor to apply a debtor's payments as it chooses, however, is qualified by the rule that where the creditor knows or should know the source of the funds from which it is paid, the creditor must, irrespective of the instructions of the debtor, apply those funds so as to protect the rights of the person supplying the funds. American Oil, 298 F.Supp. at 534; Rural Plumbing & Heating, Inc. v. Hope Dale Realty, Inc., 263 N.C. 641, 140 S.E.2d 330 (1965); Northern Va. Sav. & Loan Ass'n v. J.B. Kendall Co., 205 Va. 136, 135 S.E.2d 178 (1964). As rationalized in United States for Use of Carroll v. Beck, 151 F.2d 964, 966 (6th Cir.1945), to allow a creditor to collect an old debt out of the monies paid upon a contract, and to leave the outstanding charges for materials furnished will prejudice the principal and the surety on the bond, and if sanctioned, might cause great harm.
Dennis' testimony, which was believed by the master, adequately established that Maddux was in possession of information indicating the funds it received from Palmetto between January and June 1991 came from Benchmark in connection with the Project. Since there is evidence to support the master's findings that Maddux knew or should have known that Benchmark was the source of the funds Maddux received from Palmetto, we must affirm the master on this issue. See Stoudenmire Heating & Air Conditioning Co. v. Craig Bldg. Partnership, 308 S.C. 298, 417 S.E.2d 634 (Ct.App.1992) (A proceeding to enforce a mechanics' lien is *104 legal in nature and this court's scope of review is limited to determining if there is any evidence to support the ruling of the trial court).

II.
Maddux next contends the master erred in using Palmetto's general ledger to analyze certain deposits and withdrawals to determine the portion of deposits attributed to payments from Benchmark. Maddux argues the master's tracing analysis was improper because: (1) there is no correlation between the payments by Benchmark to Palmetto and the payments by Palmetto to Maddux; (2) bank statements are required to properly trace funds; (3) the ledger only covers a portion of the job; (4) Palmetto admitted it could not trace the payments; (5) Palmetto's payments lacked a pattern; and (6) tracing does not extend to advances.
The theory upon which Benchmark predicates its claim of tracing is that Palmetto's account ledger indicates that in January, February, and March of 1991, Maddux received payment from Palmetto immediately following Palmetto's receipt of payment from Benchmark in connection with the Project.[2] This fact alone, Benchmark argues, shows a correlation between these payments, and when it is combined with Dennis' testimony that she was asked to post-date checks to Maddux and that she told Maddux that the funds for these payments came from Benchmark in connection with the Project, the correlation is even stronger.[3]
Recognizing that `identical money' tracing is not required, it is apparent that the January, February and March payments had their origin in payments received from Benchmark.[4] Thus, we agree with Benchmark that a undeniable correlation exists between the payments by Benchmark to Palmetto and the payments by Palmetto to Maddux.
Maddux cites no authority in support of its next claim that bank statements are required to properly trace funds, and we find the claim to be manifestly without merit. In American Oil, there is no indication that bank statements must be utilized to trace funds, and, in fact, the district court in American Oil accepted the surety's method of tracing which was the same method used by the master in this case. Id. at 537. Likewise, Maddux's claim that tracing does not extend to advances is also without merit. In American Oil, the court utilized a tracing analysis relating to advances. Id at 537 ("[t]he theory upon which Great American predicates its claim of tracing is that, immediately prior to these payments ... Brown had received advances upon the Lexington project and that it must be assumed, therefore, that the payments to American were made from such advances").
*105 Maddux's contention that Palmetto's account ledger only covers a portion of the job is true, but immaterial. The ledger documents the activity of Palmetto's general account from January to August 1991, which is sufficient in that it includes the time period relevant to Palmetto's deposit of checks from Benchmark and Palmetto's issuance of checks to Maddux.
Maddux's next claim that Palmetto admitted it could not trace funds is contrary to the master's findings and totally unsupported by the record. When Dennis testified that she could not tell what the checks applied to without a designation, she was referring to her inability to match the specific checks written to Maddux with specific material supplied by Maddux. In clarifying her response, the court stated, "[I]f the amount was an identical amount to an invoice or something, perhaps you could do it, but I gather from previous testimony that the payments were in round figures, or an amount that she had available, and no direct tie-in to any of the invoices sent by Maddux."
The claim that the payments to Maddux lacked a pattern is also without merit. The deposit of Benchmark's checks immediately followed by the issuance of checks to Maddux clearly shows a pattern. See supra text accompanying note 2.
Finally, Maddux's assertion that it did not prohibit Palmetto from placing designations on checks is contrary to the master's finding and unsupported by the record. The master found that "unrefuted testimonial evidence indicates that Palmetto attempted to designate its payment to Maddux toward the invoices for the materials used at the Project. However, Maddux refused to allow Palmetto to so designate its payments and, instead, applied the payments made with Benchmark funds toward Palmetto's prior outstanding balance." Since Dennis' testimony supports this finding, it provides an adequate basis for affirming the master on this issue. See Stoudenmire, 417 S.E.2d at 636.

III.
Maddux asserts that the master erred in holding that Safhi could pay Benchmark, rather than Maddux, after receiving notice of Maddux's mechanic's lien. Maddux further asserts that pursuant to S.C.Code Ann. § 29-5-50 (1991), Safhi should be required to pay Maddux the sum of its claim, as Safhi was not authorized to make its payment to Benchmark. We disagree.
Contrary to Maddux's first assertion, the master did not hold that Safhi could pay Benchmark instead of Maddux. Instead, the master held Maddux, rather than Safhi, was responsible for assuring proper credit for payments received from Palmetto. The basis of this holding is that Maddux knew or should have known that Benchmark was the source of the funds out of which Palmetto paid Maddux, and instead of discharging the indebtedness against the Project, Maddux applied the payments made with Benchmark funds toward Palmetto's prior outstanding balance.
Moreover, the fact that Safhi paid Benchmark after receiving notice of Maddux's mechanic's lien is immaterial. In a mechanics' lien action, the liability of the owner is limited to the amount the owner owes the general contractor at the time the materialman gives notice. Stovall Bldg. Supplies, Inc. v. Mottet, 305 S.C. 28, 406 S.E.2d 176 (Ct.App.1990). A payment by the owner to the general contractor after the owner has received notice of the lien is made at the owner's peril, as it will not effect the amount recoverable by the party with the mechanics' lien. S.C.Code Ann. § 29-5-50 (1991). Furthermore, any person with an interest in the property affected by a mechanics' lien may file a bond discharging that property from the lien and transferring the lien to the bond. S.C.Code Ann. § 29-5-110 (1991).
In the present case, Safhi received notice of Maddux's lien in June, 1991; Benchmark filed a bond in August, 1991; and Safhi paid Benchmark in September, 1991. Under these circumstances, any judgment awarded to Maddux would be paid by the bond, S.C.Code Ann. § 25-5-110 (1991), and Safhi's payment to Benchmark after receiving notice of Maddux's lien did not affect the amount recoverable by Maddux. S.C.Code Ann. § 29-5-50 (1991). Thus, there was no need for the master to address this issue and *106 Maddux has shown no prejudice from the omission.
Contrary to the second assertion, neither the statute nor the cases relied upon by Maddux support the proposition that Maddux is entitled to be paid the full amount of its claim by Safhi. In fact, the statute cited by Maddux clearly indicates that the owner is free to pay the general contractor after receiving notice of a mechanic's lien, but such payment will not reduce the amount recoverable by the party that filed the lien. Id. Accordingly, we affirm the master on this issue.

IV.
Maddux also argues the master erred in failing to allocate the funds which Benchmark currently holds in retainage. Maddux asserts that the retainage funds should be used either to offset any amount this Court determines is owed by Maddux or to pay any amount this Court determines Maddux is owed. In support of this contention, Maddux states that the "sums are undisputedly owed by Benchmark to Palmetto, and there is no dispute that Palmetto owes sums to Maddux."
We find this argument to be manifestly without merit. As found by the master and affirmed by this Court, Maddux has been paid in full for the materials it supplied to Palmetto for use in the Project, and, therefore, Maddux is not entitled to the benefit of any funds held in retainage by Benchmark.

V.
Lastly, Maddux maintains that the master erred by awarding costs and attorney fees in this matter. In support of this argument, Maddux states that "Benchmark was not a party to the action, but a `person' filing an obligation pursuant to S.C.Code Ann. § 29-5-110 (1991)," and, therefore, Benchmark cannot recover the costs and attorney fees it incurred in defending this matter. We disagree.
Clearly, Benchmark's costs and attorneys' fees were incurred in this matter for the benefit and in the interest of Safhi.[5] As reflected in the Amended Order, by filing a bond pursuant to S.C.Code Ann. § 29-5-110 (1991) to release the property subject to Maddux's mechanics' lien and providing Safhi's defense, Benchmark, as the principal on the bond, assumed Safhi's position in the case. Thus, we concur in the master's ruling that "as the prevailing party, Safhi (for the benefit of Benchmark, as the party which secured the discharge of the subject property by the filing of its bond and as the party to which Safhi tendered the defense of this matter) is entitled to an award of costs and attorneys' fees ..." See S.C.Code Ann. § 29-5-20 (1991) (the prevailing party in a mechanics' lien action is entitled to an award of costs and reasonable attorneys' fees).
For the forgoing reasons, the appealed order is
AFFIRMED.
HOWELL, C.J., and CONNOR, J. concur.
NOTES
[1]  Benchmark filed a bond on behalf of Safhi, pursuant to S.C.Code Ann. § 29-5-110 (1991), to release the property subject to the mechanics' lien and transfer the lien to the bond.
[2]  Palmetto's $50,000 payment to Maddux on January 26, 1991 was made two days after Palmetto received a $53,470 check from Benchmark. The day prior to receiving this payment from Benchmark, Palmetto's account balance was only $4,780. Thus, the master concluded that even if part of the $50,000 paid to Maddux came from Palmetto's prior balance, at least $45,219 of the payment to Maddux consisted of Benchmark funds. Likewise, Palmetto's $20,000 payment to Maddux on February 28, 1991 was made two days after Palmetto received a $35,269 check from Benchmark. The day prior to receiving this payment from Benchmark, Palmetto's account balance was only $7,122, and, thus, the master found that even if part of the $20,000 paid to Maddux came from Palmetto's prior balance, at least $12,877 of the payment to Maddux consisted of Benchmark funds. Similarly, Palmetto's $50,000 payment to Maddux on March 26, 1991 preceded Benchmark's $43,560 payment to them by only one day. On March 25, 1991, the day Palmetto received the payment from Benchmark, Palmetto's account balance was $18,638. Accordingly, the master concluded that even if part of the $50,000 paid to Maddux came from Palmetto's prior balance, at least $31,361 of the payment to Maddux consisted of Benchmark funds.
[3]  Dennis testified that "Steve Gallimore or Tony Terry would come out, they would ask me who am I going to get the checks from, and what amount I was going to get, and if I would post date them a check ... they would hold it until money came in."
[4]  In American Oil, the district court recognized that a payment out of an account which immediately follows a deposit into that account is traceable to the funds of the deposit. Furthermore, although `identical money' tracing is not required by American Oil, the master's analysis indicates that at least $89,458 of the funds Palmetto paid to Maddux must have been the identical funds Palmetto received from Benchmark.
[5]  Attorneys' fees incurred by Benchmark resulted from it discharging the mechanics' lien by the filing of a bond in accordance with S.C.Code Ann. § 29-5-110 (1991) and its defense of the present action through Safhi. A judgment arising out of this action against Safhi would have been satisfied out of the bond purchased by Benchmark because Benchmark was the party responsible for and liable under the bond. In this situation, Benchmark assumed Safhi's position in this case, and its costs and attorneys' fees are recoverable by Safhi as the prevailing party.
