This action was brought by respondent against appellant railroad company to recover damages for the alleged killing by appellant company of a certain bull belonging to respondent at a place where the right of way passes along inclosed lands and cultivated fields. Eespondent demanded $200 from the company and upon its refusal to pay, brought this action for that amount and for $75 attorney fees. The ease was tried to a jury and a verdict was returned for respondent awarding him damages in the sum of $175. The court entered judgment for this amount and also included in its judgment $75 attorney fees. This appeal is from the judgment.
The chief assignment of error is that “The court erred in awarding attorney’s fees to the plaintiff, and in entering judgment accordingly. ” It was stipulated that $75 was a reasonable attorney fee provided attorney fees could be lawfully *136assessed, but appellant objected to the allowance of such fees on the ground that the statute under which they were claimed is unconstitutional in that it denies to appellant the equal protection of the law and deprives it of its property without due process of law. The section of the statute in question is sec. 2818, Eev. Codes, as amended by chap. 223, Session Laws of 1911, which reads as follows:
“See. 2818'. In all suits under See. 2815 of the Eevised Codes of Idaho, as amended, aforesaid, if the plaintiff recover any damages he shall also be entitled to recover reasonable attorney’s fees, together with his costs of suit.”
It is the contention of appellant that this section contravenes the following provisions of the fifth and fourteenth amendments to the constitution of the United States:
“Article V.....nor shall any person .... be deprived of life, liberty, or property, without due process of law;
“Article XIV.....nor shall any state deprive any person of life, liberty, or property, without due process of law; nor deny to any person within its jurisdiction the equal protection of the laws.”
Inasmuch as the fifth amendment to the constitution of the United States is a limitation solely upon the powers of the federal government, it can have no application to the section of our statute in question (12 C. J. 1194), and we will confine this portion of the opinion to a consideration of the question presented with reference to the fourteenth amendment.
While it is doubtful whether the complaint is sufficient to tender an issue under the statute requiring railroads to fence, this defect is cured by the allegations in the answer. At any rate, the case was tried upon the theory that the issue raised was under the statute above referred to and this court has recently held that “where both parties to an action try their ease upon the same' theory as to' the issue tendered by the pleadings, they are bound by the theory so adopted.” (Brown v. Hardin, 31 Ida. 112, 169 Pac. 293.)
Furthermore, the jury evidently found, and the finding is abundantly supported by the evidence, that respondent’s bull *137came upon appellant’s right of way at a place where the railroad company was required to maintain a lawful fence and where the fence was down. The question is, therefore, squarely presented: Can attorney fees be imposed upon a railroad company under a statute providing for their recovery where, under the facts, it has clearly violated the provision of the statute requiring such companies to maintain a lawful fence along their rights of way 1
The answer to this question depends largely upon the purpose of such statute. The authorities, construing similar statutes are conflicting and, as pointed out in the extended note to Builders’ Supply Depot v. O’Conner, 17 L. R. A., N. S., 910, “much of this confusion, however, may be ascribed to attempts upon the part of other courts to follow the apparent changes of position of the United States supreme court on the subject.”
We shall not attempt here to review all of the conflicting decisions upon the question involved, but shall confine ourselves to those decisions which, in our opinion, correctly state the law applicable to the situation which is presented by our statute and the facts here in issue. This court has long since held that “the statute requiring railroad companies to fence their rights of way .... is a police regulation adopted to protect human life and property for the benefit of the general public and not for the sole benefit of adjoining or contiguous land owners.” (Johnson v. Oregon Short Line Ry. Co., 7 Ida. 355, 63 Pac. 112, 53 L. R. A. 744.) We are in accord with the rule there announced. We are confronted, then, with a statute providing a proper police regulation requiring railroad companies, under such circumstances as existed in this case, to maintainTawful fences along their rights of way for the public safety and with a clear violation of the requirements of the statute by the railroad company.
The provision of the section authorizing the recovery of attorney fees in cases of this character, sec. 2818, supra, is not designed to compel the railroad company to pay its debts, but the evident purpose of this provision is to compel railroad companies to comply with the law requiring them to maintain *138lawful fences along their rights of way for the public safety and to provide a penalty for their violation of this statutory duty. We are satisfied that these elements bring this case within the reasoning of the supreme court of the United States in Atchison, T. & S. F. R. Co. v. Matthews, 174 U. S. 96, 19 Sup. Ct. 609, 43 L. Ed. 909, see, also, Rose’s U. S. Notes. In the latter case a statute of the state of Kansas made railroad companies liable for damages by fire caused by the operating of railroads and provided that in actions commenced under the act, if the plaintiff recovered, he should be allowed a reasonable attorney fee. The statute was upheld as a proper police regulation, the supreme court saying:
“Its monition to the railroads is not, pay your debts without suit or you will, in addition, have to pay attorney’s fees; but rather, see to it that no fire escapes from your locomotives, for if it does you will be liable, not merely for the damage it causes, but also for the reasonable attorney’s fees of the owner of the property injured or destroyed.”
So in this case, our statute does not threaten the railroads with the infliction of this penalty unless they pay their debts without suit, but does say to the railroad companies, where your right of way passes along cultivated fields or inclosed lands, you must maintain a lawful fence and if you do not so maintain such fence, you will be liable not only for the damage caused, but for reasonable attorney fees of the owner of the property injured or destroyed. It may be that a better or a more appropriate statute could have been devised by the legislature, but that question is not before us; it is only necessary for us to determine whether the legislature has exceeded its constitutional power. Upon this point let us again refer to the decision in the Matthews case, where the supreme court of the United States said:
“We have no right to consider the wisdom of such legislation. Our inquiry runs only to the matter of legislative power. If, in order to accomplish a given beneficial result— a result which depends on the action of a corporation — the legislature has the power to prescribe a specific duty and punish a failure to comply therewith by a penalty, either *139double damages or attorney’s fees, has it not equal power to prescribe tbe same penalty for failing to accomplish the same result, leaving to the corporation the selection of the means it deems best therefor? Does the power of the legislature depend on the method it pursues to accomplish the result? As individuals we may think it better that the legislature prescribe the specific duties which the corporations must perform; we may think it better that the legislation should be like that of Missouri, prescribing an absolute liability, instead of that of Kansas, making the fact of fire prima facie evidence of negligence; but, clearly as a court we may not interpose our personal views to the wisdom or policy of either form of legislation. It cannot be too often said that forms are matters of legislative consideration; results and power only are to be considered by the courts.” (Atchison, T. & S. F. R. Co. v. Matthews, supra.)
The view -we have taken follows as a matter of course when account is taken of the previous decisions of this court that such a statute is a police regulation. The principle involved has been clearly stated by the supreme court of Illinois in the following language:
“The further objection is made that this provision for attorney’s fees is unwarrantable, as being special legislation, in singling out one class of corporations and attaching this liability to one class of cases. This provision may be upheld as being in the nature of a penalty for noneomplianee with the statutory duty of fencing. The requirement of the fencing of railroad tracks is not alone for the private benefit of the owners of stock along their lines, but it has respect to the public welfare as well, as a measure for the safety of travel on railroads. As a police regulation for the promotion of the public safety in that respect, the legislature may well require the fencing of their railroad tracks by railway companies, and provide penalties for securing performance of the duty.” (Peoria, D. & E. Ry. Co. v. Duggan, 109 Ill. 537, 539, 50 Am. Rep. 619-621.).
(March 8, 1919.) Power oe Legislature to Impose Penalties — Purpose oe Notice— Statutory Construction. 4. In order to enforce upon a railroad company the duty to fence its right of way, the legislature may prescribe appropriate penalties. The mode in whieh such penalties shall be imposed., whether at the suit of a private party or at the suit of the public, and what disposition shall be made of the amounts collected, are matters merely of legislative discretion. 5. The purpose of C. L., see. 2817, in requiring the service upon the railroad company of notice of claim for damages, is to prevent stale claims being filed against the company, and to afford the latter an opportunity to make an investigation; the liability of the company, if any, being limited to the value of the animal or animals killed or wounded, if the company’s right of way fence has been erected and maintained as required by law. 6. Where a statute is capable of two interpretations, one of which would make it constitutional and the other would make it unconstitutional, the court should adopt that construction which will uphold the validity of the act, the presumption being that the legislature intended to enact a law which would be constitutional and enforceable. [As to duty to maintain fenees and cattle-guards, see note in 21 Am. St. 289.]We conclude, therefore, that sec. 2818, supra, is not wanting in due process of law nor repugnant to the fourteenth amendment to the constitution of the United States.
The remaining points relied upon by appellant are sufficiently covered by the recent decision of this court in Saccamonno v. Great Northern Ry. Co., 30 Ida. 513, 166 Pac. 267, and do not require further discussion here.
The judgment is therefore affirmed. Costs1 are awarded to respondent.
Morgan and Rice, JJ., concur.