delivered the opinion of the court.
Defendant leased and ran the Osage Valley & Southern Kansas Railroad, and plaintiff charges that the cars upon the road so leased run over and killed his mule and a colt, etc., and that they were killed upon a portion of the road not inclosed by a fence. We will only consider two of the defenses set up, which are, first, that the place where the animals entered upon the track was within the incorporated town of Boonville, and hence the company was under no obligation to fence the road; and, second, that the O. V. & S. K. Railroad had made a contract with the plaintiff to inclose the road with a fence at that place, and had paid him for the same. Both defenses were sustained by the evidence, but the court held them insufficient, and gave the plaintiff judgment for $500.
In regard to the first defense, it appeared that the portion of the town where the accident happened had not been laid out into lots, streets and alleys, and that no road or street had been established to eross the railroad near that point. This action is prosecuted under the fifth section of the act concerning damages, etc. (Wagn. Stat. 520), and the question is raised for the first time in this court, whether a railroad company is excused from fencing the track of its road when it runs through a town or city, merely from that fact, and without reference to whether it thereby *233crosses the public highways of such town or city. From the remarks of the court in Meyer v. N. M. R.R. Co., 35 Mo. 352, and in Iba v. Hann. & St. Jo. R.R. Co., 45 Mo. 469, such excuse seems to be inferred by counsel. But the statute makes no exception in regard to towns, but only an implied one in the crossing of a public highway. Nor do the cases referred to enlarge the exception. Ordinarily a railroad track cannot run any considerable distance within a town without being crossed by some street, either actually opened or merely established. In that case the fencing cannot be required, for it would shut up a street actually in use, or one that has been laid out and dedicated and may soon be opened. But where the corporation lines embrace portions of the adjacent country not actually laid out as a town, or so laid out that no streets cross the railroad, the reason for the exception does not apply, and the obligation to fence is as imperative as outside the corporation limits.
The second defense is a perfect one as against this plaintiff. Defendant claims that the railroad company whose road it leased had taken the proper steps toward complying with the law, and that it was the fault of the plaintiff that it had not been fully complied with. To permit him to take advantage of this default would be contrary to reason and justice ; would give him damages for the failure in the company to do what he had bound himself to do and had been paid for doing. (The President, etc., v. Smith, 16 Ind. 102 ; Ind., P. & C. R.R. Co. v. Petty, 25 Ind. 413.) The reports of the different States are full of authorities sustaining this view, and it applies as well to cases where the statute requires the railroad company to fence as to where there is no such requirement. The following instruction upon this point was asked and refused:
“ If the jury believe from the evidence that the plaintiff agreed and contracted with the Osage Valley & Southern Kansas Railroad Company to build a fence along the line of said railroad and on plaintiff’s land, and failed and neglected to build said fence, and by reason of such neglect and failure on the part of the plaintiff, stock belonging to plaintiff came upon the track of said road at a point where plaintiff had agreed to fence, and was *234killed by the engines and cars of defendant running on said road, they will find for defendant.”
There was no evidence of any carelessness and negligence on the part of the company except the neglect to fence, and the refusal to give the above instruction was clearly erroneous ; and the other judges concurring, the judgment is reversed and the cause remanded.