The opinion of the court was delivered by
Johnston, J. :Nathaniel S. Hart brought an action against the city of Kansas City, Kan., S. N. Simpson, and others, in which he alleged that Simpson and others, with their servants and employees, in digging out and hauling sand from a sand-bank in one of the alleys of Kansas City, undermined the sand-bank, leaving a large body of earth overhanging and liable to cave in and fall upon persons passing through the alley; that the defendants knew, or should have known, of the perilous condition of the excava*686tion, and also that small children were in the habit of playing in the alley and in and about the excavation ; that on October 18, 1894, the defendants left the excavation so made in such a negligent and dangerous condition “that suddenly and without warning it fell upon the eleven-year-old child, a daughter of this plaintiff, of the name of Daisy Hart, and did so crush, wound and bruise her that she did then and there die ; that plaintiff, by reason of the death of said child, so carelessly and negligently killed by said defendants, has been deprived of the love, care and assistance of said child, and deprived of the labor and earnings of said child from said date until she became twenty-one years old ; also, that by reason of the sudden death of said child, plaintiff’s wife, the mother of the said child, has been made sick and unable to do the housework, and plaintiff has thereby been compelled to and does keep help to do the work necessary about the house ; that by reason of the death of said child the plaintiff has been damaged in the sum of $10,000,” for which he asked judgment-. Afterward, and on motion of the defendants, the court struck out the averment of damages resulting from the sickness and loss of services of the child’s mother. The defendants answered separately, alleging a misjoinder of parties, a want of power in the plaintiff to prosecute the action, and the contributory negligence of Daisy Hart and her parents. .
The action was commenced on December 28, 1895, and came on for trial on December 9, 1896, more than two years after the injury and death of Daisy Hart. On an objection to evidence the plaintiff then asked and obtained leave to amend his petition in order that he might recover under the statute as the next-of-kin of the deceased child. By interlineation he amended, *687alleging the residence of Daisy. Hart at the time of her death, that no personal representative had been appointed, and that the plaintiff was her father and the next-of-kin. A demurrer of the defendants to the sufficiency of the amended petition was confessed by the plaintiff, and he then, upon leave of court, amended his petition as follows : “ That Daisy Hart at the time of her death, as hereinafter alleged, was a resident of this state, that no personal representative has been appointed for her estate, and that she left no husband surviving her, but did leave surviving her her mother and her father, who is plaintiff in this action, and that* her mother died on the 21st day of September, a. d. 1896, and the plaintiff is the next-of-kin of said Daisy Hart, deceased.”
The amendment was made on January 26,1897, and on February 5, 1897, a motion was made to strike the amended petition from the files on the ground that the amendment was a substantial departure, both in law and in fact, from the cause of action originally set up, but the motion was overruled. The objections that the amended petition constituted a departure from the original and set up a new cause of action which was barred by the statute of limitations were raised by answer and in various ways, but were not sustained. The trial resulted in a judgment rendered against the city and S. N. Simpson jointly for $4000, and the city and Simpson complain of the rulings of the court and bring them up for review in two separate proceedings in error.
Hart asks for a dismissal or abatement of the proceedings, because the city and Simpson did not unite in bringing a single proceeding for review. It would seem that both might have joined in bringing the case to this court, and in that way avoided the trouble and *688expense of more than one proceeding. This is certainly the better practice when it can be done, but it' is not practical where the complaining parties have distinct and conflicting interests. When the interests are not identical, or the parties against whom judgment has been rendered are really adverse toward each other, there may be good reasons why one should refuse to unite with the other. In such cases, either may make the other a defendant in error, and as such he ordinarily can fully present his errors and protect his separate interests upon a cross-petition in error in that proceeding. So far as we can discover, that practice might have been followed in this case. All parties against whom a joint judgment has been rendered are necessary parties to a review, and the failure to join them, either as plaintiffs or defendants, is generally ground for dismissal. These proceedings, however, are not subject to that objection, as Simpson has been made a defendant in error in the proceeding brought by the city of Kansas City, and the city of Kansas City a defendant in error in the one brought by Simpson. All the parties are before the court in each of the proceedings, and the fact that there are two proceedings would not warrant a dismissal of both. Possibly a question might ultimately arise as to the matter of costs, if the proceedings result against the judgment creditor, but as the parties have not been heard on that proposition it will not be determined at this time.
The first and controlling question on the merits of the case arises on the amendment of the plaintiff’s petition. .The original petition set up a claim by the plaintiff for a loss of seiwices of his daughter resulting from the negligent action of the defendants, while the amendment alleged a claim by plaintiff, as next-of-kin, *689for damages resulting from the death of Daisy Hart. The original petition alleged a claim under the common law, while the amended petition set forth a claim for death, the right to maintain which is given only by statute. (Civil Code, § 422; Gen. Stat. 1897, ch. 95, § 418; Gen. Stat. 1889, ¶ 4518.) As will be observed, the amendment was filed about two years and three months after the injury and death, and- actions to recover for death are barred by the statute of limitations in two years after the death occurs. It, therefore, became a material question whether the two-year period of limitation was reckoned from the date of the filing of the original petition or from the date of the filing of the amended petition. If the amendment was permissible and relates back to the filing of the original, the action was not barred. On the other hand, if it alleged a new and different right of action, which con-' stituted a departure either in law or fact, the bar of the statute is as available as if the amendment were a new and independent action. The averments of the original petition clearly indicate an attempt to state a common-law liability, and this was the view taken by the trial court, who in his instructions told the jury that the original petition upon its face merely contained allegations which .constituted a cause of action at common law, and did not set up a cause of action under the statute. While holding this view, the trial court permitted oral testimony as to the intention of the plaintiff’s attorney in drawing the pleading — whether he intended to state a cause of action under the common law or under the statute, and upon this testimony submitted to the jury'the question whether the cause of action sued on originally was the same cause of action set out in the amended pleading. In holding this view the trial court doubtless felt bound *690by and .followed the rule in Ball v. Biggam, 6 Kan. App. 42, 49 Pac. 678, a decision which we cannot approve.
We are clearly of the opinion that the effect of a pleading is to be determined by its averments, and not by the statements of the pleader as to what he intended that it should contain. As was said in Haley v. Hobson, 68 Me. 167, “the court looks to the declaration to ascertain what causes of action are provable under it, and not to the mind of the plaintiff when he commenced his action. The intention of the plaintiff at that time to recover upon an item not embraced, within the purview of the declaration will not avail him, nor will his want of an intention to maintain a particular claim prevent his recovery for that, if it is recoverable under the declaration.” Looking, then, at the original petition, it plainly appears to contain a complete cause of action, but quite unlike the one on which a recovery was had. The true criterion is, Did the: plaintiff so state his cause of action originally as to show that he had a legal right to recover what he subsequently claimed?
The right of action under the statute is a conditional one, and unless the plaintiff brings himself within the prescribed conditions the action cannot be maintained. (Hamilton v. H. & St. J. Rld. Co., 39 Kan. 56, 18 Pac. 57.) The action for death is distinct and independent from an action for services under the .common law, and a different measure of damages is applied. In City of Eureka v. Merrifield, 53 Kan. 794, 37 Pac. 113, which was an action by the next-of-kin to recover for a death, it was held that the petition must allege that the deceased at the time of his death was a non-resident of this state, or, if a resident of the state, that no personal representative of his *691estate had been appointed, and the omission of these averments was held to be a fatal defect. In that case the distinction between an action for death and the common-law action f'or injury is pointed out, and reasons are given why it cannot be maintained except under the statutory conditions. In the recent case of Walker v. O’Connell, 59 Kan. 310, 52 Pac. 894, the court, in speaking of the ruling in City of Eureka v. Merrifield, remarked that “.the decision of that case is well sustained by other like authorities. Its reasoning is entirely satisfactory to us, and it applies to all the various instances in which the rule was invoked in this case.” These essential averments were entirely absent from the original petition, and there was nothing to indicate a claim of the particular and exceptional right given by the statute until the amendment was filed, and at that time the bar of the statute against the assertion of such a claim was complete. The amendment, as we have seen, intro,duced a distinct liability, and “while the courts are liberal in permitting parties to amend their pleadings, they are not warranted in allowing amendments which substantially change the claim or defense previously-relied upon.” (Jewett v. Malott, ante, p. 509, 57 Pac. 100; Walker v. O’Connell, supra.) It is true, as a general rule, that amended pleadings relate back to the commencement of the action, but this rule never obtains where a separate and distinct cause of action is set up by way of amendment. Even though the amendment might otherwise be allowable, it is generally held that it will not be permitted when the effect will be to make the state of facts pleaded relate back so as to avoid the statute of limitations if the new cause of action would be otherwise barred. (Box v. C. R. I. & P. Rly. Co., 78 N. W. [Iowa] 694.) As the *692doctrine of relation rests on a fiction of law invented for the purpose of accomplishing justice, courts can hardly allow a new and different right of action which is barred to be engrafted on the original one that was not barred, and thus deprive the defendant of his defense of the statute of limitations.
A. T. & S. F. Rld. Co. v. Schroeder, 56 Kan. 731, 44 Pac. 1093, is a case quite analogous to the one under consideration. The plaintiff, who was an employee of the,railroad company and was injured in the service, brought an action alleging that the company had failed to perform its common-law duties of a master toward him. More than two years after the injury he amended his petition, alleging that the injury was the result of the negligence of a fellow servant;, and alleging a liability under the statute. The question arose there, as it does here, whether the amendment related back to the filing of the original petition, and the court reached the conclusion that they were distinct and independent causes of action and were based on .different grounds of liability, and that the amendment would not relate back to the commencement of the action. In that case.it was held that although the employee had but one grievance, which was the personal injury sustained by him, he could not, by adding an amendment which set up the statutory liability after having relied upon the common-law liability in the original petition, deprive the defendant below of the benefit of the statute of limitations as to such added cause of action.
Railway Co. v. Wyler, 158 U. S. 285, 15 Sup. Ct. 877, is a pertinent and instructive authority on this question. An action was. instituted in Missouri by Wyler for injuries caused by a fellow servant in Kansas. Within the period of limitation he brought an action stating a failure of the railroad company in its duties *693toward him as master — a common-law liability. After the statute had run, Wyler amended the petition, alleging the negligence of a fellow servant, and attempting to bring the case within the Kansas fellow-servant law, and the court held that the amendment introduced a new cause of action', and that it was barred by the statute. It was said :
“ If the charge of incompetency in the first petition was not per se a charge of negligence on the part of the fellow-servant, then the averment of negligence apart from incompetency was a departure from fact to fact, and, therefore, a new cause of action. Be this as it may, as the first petition proceeded under the general law of master and servant;, and the second petition asserted a right to recover in derogation of that law, in consequence of the Kansas statute, it was a departure from law to law. . . . The most common, if not the invariable, test of departure in law, as settled by the authorities referred to, is a change from the assertion of a cause of action under the common or general law to a reliance upon a statute giving a particular or exceptional right.” See Hiatt v. Auld, 11 Kan. 176; Lilly v. Railroad Co., 32 S. C. 142, 10 S. E. 932; Barker v. Anniston, Oxford & Oxanna Street Ry. Co., 92 Ala. 314, 8 South. 446; E. L. & Red River Ry. Co. v. Scott, 75 Tex. 84, 12 S. W. 995; Flatley v. Memphis & Charleston Railroad Co., 9 Heisk. (Tenn.) 230; Hurst v. Detroit City Railway, 84 Mich. 539, 48 N. W. 44.
Although the wrong or injury inflicted by the defendant may be the saíne in both cases, the amendment setting up a liability under the statute is deemed to be a new cause of action so far as the statute of limitations is concerned. In Holliday v. Jackson, 21 Mo. App. 660, the petition set up a common-law trespass. More than three years after the trespass an attempt was made to amend the petition so as to claim treble damages under a statute allowing such damages, but which prescribed a three-years’ limitation. *694Although both counted on the cutting and carrying away of timber, it was held that the amended petition stated a different cause of action and that the bar of the statute would apply. In Parmelee v. The Savannah, Florida & Western Railway, 78 Ga. 239, 2 S. E. 686, an action was brought against a railway company for excessive charges, which, it was alleged, were made in violation of a statute of that state. The plaintiff sought to amend by declaring on a common-law liability so as to save his claim from a special statute of limitations, but it was held that this would be to add a new cause of action by amendment, and that it could not be done. In Cotton Mills v. Railroad Co., 88 Ga. 441, 10 S. E. 118, an action was brought against the railroad company on a common-law liability, and an attempt to amend it, claiming a recovery on a statutory liability, was not allowed. See also Lambard v. Fowler, 25 Me. 308; Fairchild v. Dunbar Furnace Co., 128 Pa. St. 485, 18 Atl. 443; Melvin v. Smith, 12 N. H. 462; Hausberger v. Pacific Railroad Co., 43 Mo. 196; Newton v. Allis, 12 Wis. 378.
It is true that the original petition and amendment both alleged the same injury, but they are founded on entirely different rights, and testimony which would support the one would not support the other, while different rules apply in the measurement of damages in the two cases. It is clear that the amendment at least constitutes a departure from law to law, as set out in the authorities above quoted, and therefore we are forced to the conclusion that the cause of action set up by the plaintiff against the defendants in the amendment, and upon which a recovery was obtained, was barred by the statute of limitations.
The judgment against the defendants will be reversed and the causes remanded for further proceedings.