This action was brought under the Pub. Sts. c. 112, § 214, as amended by the St. 1895, c. 293 (R. L. c. 111, § 270), to recover for an injury to the plaintiff’s property by fire communicated by one of the defendant’s locomotive engines. The Public Statutes create a liability in such cases, and the amendment provides as follows: “ In case such railroad corporation is held responsible in damages it shall be entitled to the benefit of any insurance effected upon such property by the owner thereof, less the cost of premium and expense of recovery. The money received as insurance shall be deducted from the damages, if recovered before the damages are assessed; if not so recovered the policy of insurance shall be assigned to the corporation held responsible in damages, and such corporation may maintain an action thereon.” This statute, as amended, determines the rights and liabilities of property owners and railroad corporations. It is applicable as well when a policy is made payable in case of loss to a mortgagee as when the in*554surance is for the owner alone. It is unnecessary to consider how the rights of different parties would be enforced in every possible case, as no question of that kind is before us.
In this case the plaintiff had been paid a large sum under a policy of insurance, and the only question is whether the judge should have ruled as requested “ that the railroad corporation was entitled to the benefit of any insurance upon such property, less the cost of premium and expense of recovery, and that such amount should be deducted from the amount found as damages for such burning of the house and barn.” The case is plainly within the language of the amendment above quoted, for it is clear that this language refers to the conditions at the time of the fire. It is admitted that the ruling should have been given, except for the.fact that the insurance policy was issued before the statute was amended. The statute does not in terms recognize any distinction between cases in which a policy existing at the time of a fire was issued only a short time before the fire and after the enactment of the amendment, and cases in which the policy was issued before the change in the law. If there is a difference, it must be for some reason not referred to in the statute.
The enactment is for the purpose of fixing the rights and liabilities of railroad corporations and"property owners. ' Formerly there was an absolute primary liability of the railroad company for all damages, and an insurance company compelled to pay a loss would be entitled to be subrogated to the rights of the property owner against the railroad corporation on equitable grounds, even if there were no provision for it in the policy. It is not questioned that the Legislature could at any time terminate the liability of railroad corporations for future fires, or limit it, or modify it in any way. The Legislature has seen fit to limit it to such amounts as are not covered by insurance, and in cases where there is insurance to leave the primary liability on the insurance company, where it would be if there were no statute imposing a burden on railroad companies. There is no good reason why the law should not be changed as between landowners and railroad corporations, as well in cases where there are outstanding policies of insurance as in cases where there is no insurance, unless such a change would impair the obligation of the contract between the plaintiff and the insurance company. *555The only part of their contract that is material is found in the Massachusetts standard form of policy, and reads as follows: “And whenever the company shall pay any loss, the insured shall assign to it, to the extent of the amount so paid, all rights to recover satisfaction for the loss or damage from any person, town or other corporation, excepting other insurers; or the insured, if requested, shall prosecute therefor at the charge and for the account of the company.” St. 1894, c. 522, § 60.
The assured agrees to give the insurance company such rights to reimbursement as he may have at the time of the fire against any party. He does not agree to have any such rights. So far as the existence of such possible rights depends on present or future legislation, both parties to the contract take their chances as to what the law may be when a fire occurs. If, when a policy is issued other parties are in such relations to the property described that if the property should be burned there would be a valuable right of subrogation in favor of the insurer, it may well be that under such a provision in the policy the insured impliedly agrees to do nothing to terminate or modify the right. If in this case the law had remained unchanged, and the plaintiff, before the fire, had released the railroad corporation from its liability under the statute, it might be held that his contract with the insurance company was broken and that he was precluded from recovery under his policy. See Jackson Co. v. Boylston Ins. Co. 139 Mass. 508, 512; Attleborough Savings Bank v. Security Ins. Co. 168 Mass. 147. But no such effect can be given to a change of the law in reference to the liability of railroad companies for fires. Both the insurance company and the plaintiff knew that such a change was liable to be made at any time, and that it might materially affect the value to the company of the general right of subrogation which was expressly given by the policy. There is no good reason for holding that such an amendment, which is applicable in terms to all fires that occur after it takes effect, is not applicable as well to those fires against which insurance was effected before the passage of the statute, as to those where policies were issued after the passage of the statute. The questions that arise as to the method of applying and enforcing the statute are precisely the same in cases where the insurance was effected after the amendment *556was enacted as in those where it was in existence at the time of the amendment.
A like decision was made unanimously under a similar statute, in Leavitt v. Canadian Pacific Railway, 90 Maine, 153.
.Exceptions sustained.
Loring, J.I regret that I am unable to agree with the judgment of the court.
This action is brought by the Middlesex Mutual Fire Insurance Company, in the name of the plaintiff, to recover for damage done to the plaintiff’s house and barn by a fire set by one of the defendant’s locomotives. The action is also brought to recover for damage to personal property not insured, and the judge found that the damage done to the house and barn exceeded the insurance; to that extent the action is also for the benefit of the plaintiff; but there is no dispute as to the action, so far as it is an action for the plaintiff’s benefit; it is only so far as it is for the benefit of the insurance company that the railroad has set up a defence, and for that reason it must be treated as an action brought by the insurance company for its own benefit, in the name of the plaintiff.
The plaintiff’s house and barn were set on fire by the defendant on June 15,1895; at the time of the fire the insurance company was liable to indemnify the plaintiff for this loss under a policy issued September 1, 1893; one of the terms of the policy, whereby the insurance company had agreed to indemnify the plaintiff against loss by fire, was that whenever it should “ pay any loss, the insured shall assign to it, to the extent of the amount so paid, all rights to recover satisfaction for the loss or damage from any person, town or other corporation, excepting other insurers.” In compliance with this provision of the policy, the plaintiff did in fact assign his right of action against the railroad on the insurance company’s paying him the amounts specified in the policy, to wit, $1,500 on the house and $1,000 on the barn; and this action is brought under that assignment.
The defendant sets up in defence St. 1895, c. 293, which took effect April 18, 1895.
The insurance company contends that that act cannot affect its contract with the plaintiff, which was made a little • over a *557year and a half before the act was passed; and I think that it is right in that contention.
Had the policy contained no stipulation as to subrogation, I agree that the Legislature could have taken away the common law right of subrogation against the railroad and could have transferred the abutter’s insurance to the railroad. I think it could have done so on the same ground as that on which it is held that a consignor can agree in a bill of lading to give the carrier the benefit of his insurance, when his policy does not contain any stipulation preventing him from so doing. Jackson Co. v. Boylston Ins. Co. 139 Mass. 508.
But where it is stipulated in the policy that the insurer shall be subrogated to the rights of the assured, neither the assured nor the Legislature can give the railroad the benefit of the insurance against the protest of the insurance company. The risk assumed by an insurance company under a policy issued to an abutter for indemnity from fire set by a. railroad, with a clause giving the insurance company the right to be subrogated to the abutter’s right against the railroad, is a different risk from that assumed in case a policy is issued to the railroad for indemnity from the same fires. In case of the first policy, the insurance company has a contract right to be subrogated to the assured’s right against the railroad, whatever it may be ; if it is absolute, the insurance company, on paying the abutter, can recover from the railroad on proving that the fire was set by it; if the liability of the railroad depends upon its having , been negligent, the insurance company must prove negligence on the part of the railroad to make good its claim against the railroad for the loss. But if the company issues a policy to the railroad, its liability is final in every event. If has been held for that reason that a consignor who holds a policy containing such a stipulation cannot transfer his insurance to the carrier. Carstairs v. Mechanics' & Traders' Ins. Co. 18 Fed. Rep. 473. Fayerweather v. Phenix Ins. Co. 118 N. Y. 324. Insurance Co. of North America v. Easton, 73 Tex. 167.
This conclusion cannot be avoided by holding that St. Í895, c. 293, is an act modifying Pub. Sts. c. 112, § 214, which makes railroads absolutely liable for fires set by them in place of leaving the matter at common law, where' they were liable for negligence only.
*558I agree that the Legislature could repeal Pub. Sts. c. 112, § 214, and leave the liability of the railroad to be determined by the principles of the common law. For the purposes of this argument I will go further and admit that the Legislature could have provided that railroad companies should not be liable to abutters for fires set by their locomotives under any circumstances. But in passing St. 1895, c. 293, the Legislature did not undertake to modify the liability of railroads for fires set by them; what it did undertake to do was to transfer to the railroad company the abutter’s insurance; the Legislature undertook by this act to do for railroads, in case of the spark risk, what railroads had previously undertaken to do for themselves in other connections, by providing in their bills of lading that they should have the benefit of any insurance held by the consignor. The language of the act indicates that this is what the Legislature thought it was doing; the act provides that “ in case such railroad corporation is held responsible in damages it shall be entitled to the benefit of any insurance effected upon such property by the owner thereof.” This is an act which purports to transfer insurance and does not purport to be an act modifying the liability of the railroad for fires set by its locomotives.
Further, the abutter who is not insured has the right under the amended act to hold the railroad absolutely liable ; and, inasmuch as the railroad under the amended act is absolutely liable to the abutter who is not insured, St. 1895, c. 293, isl not an act modifying the liability of the railroad; it is an act dealing with the insurance of the abutter, and leaves the liability untouched.
But my difficulty goes deeper than either or both of these considerations. Whether an abutter is insured or not has nothing to do with the liability of the railroad. It is an outside contract of indemnity, which may be made or may not be made, at the pleasure of the abutter and the insurance company. I agree that after the enactment of St. 1895, c. 293, if the abutter and the insurance company elect to contract for indemnity, they must do so in compliance with St. 1895, c. 293; they must provide in their contract that the insurance' shall be for the benefit of the railroad as well as of the abutter, if the railroad elects to take it to its own use. But that result comes from the power *559of the Legislature to regulate any and all contracts insuring property within the Commonwealth. That power does not affect this contract, which was made over a year and a half before St. 1895, c. 293, was enacted.
I also agree that the Legislature could have changed the liability of railroad companies or ended it entirely, and, if it had done so, this insurance company could not have recovered in this action. All that the insurance company stipulated for was to have the abutter’s rights against the railroad, whatever those rights might be at the time of the fire.
It is said that St. 1895, c. 293, is an act which changes the liability of the railroad. But I cannot persuade myself that that is so. The fact that the abutter is insured is not in its essence a fact on which the liability of the railroad for a fire set by its locomotive engines depends. More than that, it is a fact which in its essence is such that it cannot be made a condition of the railroad’s liability for fires set by its locomotive engines. Apart from the power of the Legislature to regulate the terms of future contracts of insurance, and apart from its power to regulate the right of subrogation, the Legislature cannot provide that a railroad company shall be liable to A., who is not insured, and shall not be liable to B., who is insured. That is not a law equally applicable to all under the same conditions; it is open to the same objection that a law would be open to which provided that the railroad should be liable for setting fire to all houses painted white, and should not be liable for setting fire to houses painted in another color. Both provisions equally apply to all who come within the definition in each case, but neither is a general law applicable to all under like circumstances; and for that reason neither of them is within the power of the Legislature.
The effect of the statute is to appropriate the fund created by the policy issued by the insurance company to the extinguishment pro tanto of the liability of the railroad. This case may be taken as an example; in this case the house was insured for $1,500 and the barn for $1,000 ; it was found by the judge, who tried the case without a jury, that the amount of damage done by the fire in case of the house was $1,600, and in case of the barn $1,100; and it is admitted that the plaintiff Lyons is *560entitled to judgment for those two sums of $100. The policy-creating the fund stipulated that the insurance company should have the rights of the assured against the railroad, and this covenant amounts at least' to a covenant that the insurance created by the policy shall not enure to the railroad’s benefit. I cannot see how the Legislature can appropriate the fund created by such a prior contract to the extinguishment fro tanto of the liability of the railroad, which otherwise remains unchanged, without impairing the rights of the insurance company under the contract contained in the policy which was made before the act was passed.
For these reasons I am of opinion that the ruling made at the trial was right, and that the exceptions should be overruled.
The Chief Justice and Mr. Justice Hammond also dissent.