Defendants assign as error: “The trial court committed prejudicial error by finding facts, making conclusions of law, and entering judgment against defendants on the unpleaded theory that the defendants had wrongfully retained funds which were owed to their general contractor.” Defendants contend that plaintiff alleged in his complaint and proceeded to trial only on the theory of agency. Plaintiff did not move to amend his complaint during the course of the proceedings. We agree with defendants that prejudicial error occurred and award them a new trial.
The court, on its own motion, questioned witness O. L. Walker:
“THE COURT: Mr. Walker, in November of 1976 had all of the contract price been paid to you?
DEFENDANTS’ EXCEPTION NO. 5
Mr. Walker: No, sir.
*355THE COURT: How much of it remained unpaid?
Defendants’ Exception No. 6
Mr. WALKER: The way I have it, I’m close to Five Thousand Dollars ($5,000.00), something in that neighborhood, with the changes.
THE COURT: Do you gentlemen have any further questions?
MR. DAMERON: Your Honor, I don’t particularly want to get into the question of disputes outside this contract, so I don’t have any further questions.”
At the close of the evidence, the court stated the following:
“THE Court: I think you’re entitled to recover, Mr. Brown, but on the theory that in November the contract price had not been paid. I find that from the conversations between Mr. and Mrs. Stevens and Mr. Coker, with regard to getting the furnace put in operation, that notice was given that he had not been paid and that according to Mr. Stevens at that time, final settlement had not been made and that Mr. Coker would be paid when that was done.”
The record reveals that this is not a case wherein the doctrine of litigation by consent applies pursuant to G.S. 1A-1, Rule 15(b), of the Rules of Civil Procedure. Defendants objected to the introduction of the evidence as set out above and further indicated to the court that such was outside the scope of the pleadings. Plaintiff failed to move to amend his complaint to conform with the evidence as required by Rule 15(b). See Roberts v. Memorial Park, 281 N.C. 48, 187 S.E. 2d 721 (1972).
The case proceeded to trial on the theory that O. L. Walker was acting as agent for defendants and that plaintiff installed the furnace in question in defendants’ home by agreement with their agent. The court, on its own motion, changed the theory of the case to that of an alleged lien on funds in possession of defendants due to O. L. Walker, general contractor, after notice of a debt owed to plaintiff, one of Walker’s subcontractors, who had not been paid. This change of theory was prejudicial to defendants due to lack of notice. Defendants were not prepared to defend on the lien theory, which required certain records of pay*356ment to Walker. It appears that they would have met such defense had they had time to get certain records available to them.
This case must be reversed, even under the new theory. In order for the plaintiff to recover, the court must find that there is a debt owed by Walker to plaintiff. A debt is the foundation upon which a lien depends. Ply-Marts, Inc. v. Phileman, 40 N.C. App. 767, 253 S.E. 2d 494 (1979). The trial court failed to find that plaintiff is entitled to money judgment against Walker. The lack of the necessary finding of fact and conclusion of law required us to reverse the judgment entered in addition to the reason set out above.
For errors found in the trial, defendants are awarded a new trial.
New trial.
Judges CLARK and WELLS concur.