
    Grannahan, Respondent, v. Hannibal and St. Joseph Railroad Company, Appellants.
    1. Justices of the peace have jurisdiction of actions brought by laborers against railroad corporations under the twelfth section of the general railroad act. (R. C. 1856, p. 414.)
    2. The twelfth section of the general railroad act is constitutional in its application to railroad corporations previously created.
    3. Although a contractor under a railroad company may sublet to another, and bind such sub-contractor not to give out his contract to another, yet if such sub-contractor should violate this agreement and give out the contract to another, a laborer under the latter could maintain an action under the twelfth section of the general railroad act against the railroad company.
    
      Appeal from Macon Circuit Court.
    
    This was an action commenced before a justice of the peace under the twelfth section of the general railroad act. (R. 0. 1855, p. 414.) o The plaintiff had performed work in the construction of the Hannibal and St. Joseph Railroad, under McCormick, Knight & Riley, who were contractors under Therrill & Reed, who were contractors under J. Duff & Co., the original contractors. Notice to the company was served on the engineer of McCormick, Knight & Riley.
    
      Lamb Sf Lakenan, for appellant.
    I. The court should have dismissed the suit. The justice of the peace had no jurisdiction to try suits against a railroad corporation. No such jurisdiction is conferred by the charter of the road. The twelfth section of the general railroad act confers no such jurisdiction. That section substitutes one debtor for another and directs the necessary steps to be taken in order to enforce the right, but nowhere speaks of jurisdiction. In cases of penalties justices have jurisdiction expressly given by said act. (Sec. 51.) The court erred in refusing to permit defendant to prove that prior to the passage of the railroad law, defendant had contracted with John Duff & Co. for the entire construction and completion of the work; that said contract was subsisting at the time plaintiff performed the labor sued for; that said work was being done under said contract. No law subsequently passed coul’d affect the contract between the railroad company and Duff & Co. It is' not competent for the general assembly to pass any law impairing the obligation of contracts. If the said twelfth section be applied to companies previously organized and to contracts made by such companies for the construction of their roads prior to such general law, it would work wrong and hardship ; it would materially interfere with and impair the obligation of such contracts. (See Peters y. St. Louis and Iron Mountain Railroad Co., 28 Mo. 112.) If plaintiff is permitted to recover, defendant will be compelled to pay twice for the same work. The company could not indemnify itself against the parties with whom it contracted. Its contract was already made. The court erred in refusing to admit evidence to prove that Therrill & Reed were expressly prohibited from subletting the work. It was for work done under Therrill & Reed that notices should have been served and not for work done under McCormick, vKnight & Riley.
    
      Ryland Sf Preioilt, for respondent.’
    I. The jirstice had jurisdiction of the cause. (Mooney v. Hannibal & St. Joseph Railroad Co., 28 Mo. 570.) The fact that the charter of the company was granted before the passage of the general railroad act does not prevent plaintiff from recovering. (23 Mo. 110.) It can make no difference that the contract with Duff & Co. was also made prior to the passage of said act. The labor was performed after its passage. It did not appear that the company had paid Duff & Co. before this suit was brought. Being bound by the notice, the company could have pleaded it in bar to a suit brought by Duff & Co. If defendant was liable when the suit was commenced, it could not release itself by paying other parties, and thereby cairsing plaintiff to lose his money. If any injury resulted to Duff & Co. from the violation of the agreement not to sublet, they had their remedy against Therrill & Reed. The sub-contract is valid. No such provision could affect the laborer.
   Scott, Judge,

delivered the opinion of the court.

In the case of Mooney v. Hannibal and St. Joseph Railroad Co., 28 Mo. 570, it was held that, under the twelfth section of the general railroad law, (R. C. 1855, p. 414,) justices of the peace had jurisdiction of suits brought by laborers on the roads against the railroad companies.

It is objected to the claim of the laborer that the company was not permitted to give in evidence the fact that it had contracted with Duff & Co. to do the work on the road before the passage of the general railroad law; consequently, that it could not indemnify itself against claims of the laborers it might satisfy-, as, at the time of the contract with Duff & Go., it could not be aware that there would be any. It was competent to the general assembly to pass the law. (Peters v. St. Louis and Iron Mountain Railroad Co., 28 Mo. 112.) If the law was binding, then the company might have paid the laborers, and withheld the amounts paid from the contractors, who would know that by law their employees had a recourse against the company in the event of their failure to pay for their services. Under such circumstances, the sums paid by the company would be a fair set-off against their contractors; nor would this be any violation of the contract between them and the company. The principle involved in this law lies at the foundation of all our enactments in relation to garnishments. No one supposes that a law authorizing the garnishment of a debt contracted previously to the passage of the law would be unconstitutional.

Duff & Co. contracted with the company to build the road. They sublet their contract to Therrill & Reed and bound them not to give out their contract to any others. If they, in violation of this agreement, did sublet the contract, the sub-contractor would be the agents of Therrill & Reed; and if they performed the work as it was to have been done, Therrill & Reed would be bound to them for the price. Duff & Co. might have sued for a violation of the agreement not to sublet. But if-dhey acquiesced and the work was done by the sub-contractors of Therrill & Reed, what damage would have been sustained ? Why did not Duff & Co. interfere and prevent the last sub-contractor from doing the work, if they wished to take advantage of the agreement not to sublet ? f Affirmed. The other judges concur.  