Seevees, Ch. J.
l. practice: removal of cause. I. It is insisted the State court lost jurisdiction of the action at the time the petition and bond of Meyer and Dennison was filed, seeking a transfer ... . . n ^ _ __ , ox the action to the Circuit Court ot the United States. The transfer was sought under the act of Congress, approved March 3,1875, and the petition was based on the alleged fact that Meyer and Dennison were citizens of some other State than Iowa. The bond purported to have been signed by Meyer and Dennison as principals, and certain persons as their sureties.. The petition was not verified, and there was no evidence,.by affidavit or otherwise, presented to the court tending to support the allegations in the petition that Meyer and Dennison, or either of them, were citizens of some *409other State than Iowa. In the absence of any decision of the Supreme Court of the United States, we are unwilling to hold that merely filing a petition and bond operates as a removal of the action, or, rather, ousts the State court of jurisdiction. The mischief that will inevitably follow such a ruling is a strong argument against it. Parties seeking to obtain time, who are citizens of the State of Iowa, could present their unverified petition and bond and the State court would be powerless to prevent a removal of the cause. It does not seem reasonable that congress intended to thus bind hand and foot the State court. The only penalty for the wrongful transfer is that the cause may be dismissed, or remanded by the Circuit Court of the United States to the State court, and such order made as to costs as seems just. Such order, dismissing or remanding the cause, is reviewable by the Supreme Court of the United States on writ of error, or by appeal.
In view of the acknowledged fact that causes taken to the Supreme Court of the United States are not reached for trial under two or three years after the writ of error is sued out or appeal is taken, it therefore becomes a serious matter whether . this right of removal is practically within the uncontrollable power of a party to an action. The Act of Congress provides that the Circuit Court of the United States, to which any cause is removable, “ shall have power to issue a writ of certiorari to the State court, commanding said State court to make a return of the record in any such cause removed as aforesaid, or in which any one or more of the plaintiffs or defendants have complied with the provisions of this Act for the removal of the same, and enforce said writ according to law.” This power given the Circuit Court would seem to be ample and all-sufficient to protect the party seeking to transfer a cause, which is .wrongfully refused by the State court. But such Circuit Court cannot protect a party against whom a wrongful removal is made because of appeal to the Supreme Court of the United States. The Act of Congress further provides that the petition and bond may be filed in vacation of the State court; hence it is insisted as the State court is not in session and earn *410not pass upon the sufficiency of the petition and bond, the same, whether sufficient or not, immediately upon being filed, ousts the State court of jurisdiction. But does this necessarily follow? Suppose the petition does not show the citizenship of the party, or if it does, no proof whatever accompanies it, or that the bond is not conditioned according to law, or the securities are men of straw, and suppose the further fact to exist that the party seeking the transfer is a citizen of the State of Iowa, can it be possible the State court is deprived of jurisdiction by simply filing the petition and bond, and that the Supreme Court of the United States must determine the question of jurisdiction in each particular case before it can be Tegarded as authoritatively settled? If the power exists in the State court to determine the question of citizenship or the sufficiency of the petition or bond, in any case, it follows that it may do so in all cases, because the question is one of power or right and not as to the extent of such power or right. As no proof was offered in any way or manner, showing or even tending to show the citizenship of Meyer and Dennison, the court below did not err in retaining jurisdiction and proceeding with the trial. There is nothing in Freeman v. Howe, 24 How., 450, that conflicts with the views herein expressed.
2. —:-: After the commencement of the trial the defendant asked leave to file an amended petition and bond for the removal of the cause to the Federal Court. We incline to the opinion that such amended petition and bond could have been filed a§¡ a matter of right, if exercised at the proper time. There was, therefore, no necessity to ask leave of the court. The Act of Congress, however, provides that the petition and bond must be filed before the trial of the cause, and this must mean before the trial begins. Certainly it was not intended a party could take the chances in the State court, and, finding just before or even after the jury have retired to consider their verdict that he probably would be beaten, or because his mind had changed at some time during the trial, by reason of some adverse ruling of the court, as to where he prefers a trial, that he could then file the petition and bond and have the cause transferred. If a sufficient petition and bond had been presented and filed at *411the time leave was asked to do so, we are of the opinion it would have been too late.
II. As we understand the abstract, no exception was taken to the ruling of the court on the application of Meyer to be made a co-defendant, and Dennison alone appeals; it is therefore very doubtful whether we can review the action of the court below in this respect. Be this, however, as it may, it is clearly disclosed if Meyer had any interest at all it was in the capacity of a co-trustee with Dennison, and his answer and defense filed in the court below is identical with that of Dennison, whose answer remained on file and as to whom there was a trial on the merits. It is, therefore, clearly apparent there was no prejudicial error in the action of the court below in this respect.
3 mechanic’s niCTgetihnegai title. III. Having obtained judgment and the establishment of a mechanic’s lien against the principal defendant, the plaintiff* caused an execution to issue and the premises were so^ thereunder and purchased by plaintiff, and this it claimed amounts to an extinguishment of the lien, satisfaction of the judgment, or merger of the lien into the legal title. The lien of the plaintiff, if valid against the defendant, is prior to the lien of the mortgage under which the defendant claims. The general rule is, if the mortgagee purchases the equity of redemption from the mortgagor, the mortgage as well as the debt is extinguished. If, however, it was the intention or to the interest of the mortgagee to keep the lien alive the general rule does not apply. Ordinarily, nothing but payment of the debt or an express release will operate to discharge the lien. Vannice v. Bergen, 16 Iowa, 555; Washburn on Real Property, 611-612. The defendant was made a party to the original petition, the priority of the lien of plaintiff asserted therein, and that it be so established was prayed in the petition. But the decree rendered being ineffectual against the defendant because he was not served with notice, the plaintiff filed a supplemental petition asking that defendant’s right of redemption be foreclosed and forever barred. This petition was filed before the plaintiff purchased the premises at sheriff’s sale. A notice was published, notify*412ing defendant of this proceeding, and subsequently a decree was rendered granting the relief asked. These facts show very conclusively that it was not the intention to merge or satisfy the lien. In fact all the circumstances satisfactorily show precisely the reverse, and it very clearly appears that it was not to the interest of the plaintiff the lien should be extinguished by the purchase and sale. There is no distinction in this respect between the lien' of the mortgagee and that of the mechanic. Shields v. Keys, 24 Iowa, 298.
A court of equity will keep an incumbrance alive or consider it extinguished, as will best subserve the ends of justice. Barnes v. Camack, 1 Barb., 392, and authorities cited.
We have examined the case of The State of Iowa v. Kake, 17 Iowa, 215, and other authorities cited by counsel within our reach, and must confess our inability to see their applicability in this case. We have no hesitation, therefore, in holding that the purchase by the plaintiff at sheriff’s sale did not amount to a satisfaction or extinguishment of the lien.
4#_: coiiateral security, IV. The contract between the railway company and plaintiff provides that upon performance by the latter the former agrees Pay the latter, on the estimates of the engineer, eighty per cent of such estimates, the residue thereof to be retained until the contract was. completed. The payment on the estimates to be made every thirty days, and then follows this language: “All the money for the work hereinbefore specified to be paid by the citizens of Delaware county.” It is insisted this amounts to taking collateral security, and thereby the right to the lien has been forfeited. It is shown that at the time the contract was made a large amount of money had been subscribed, and agreed to be paid to the railway company by the citizens of such county. But there was no assignment of or setting apart other than that above stated of such subscriptions to the defendant. At most the agreement was to pay out of a particular fund, and this does not amount to an equitable assignment of the subscriptions. Christmas v. Russell, 14 Wall., 84. In Mervin v. Sherman, 9 Iowa, 331, it is said by Wright, Cii. J.: “A party who takes collateral security on the same contract is not *413entitled to a mechanic’s lien. This means either a separate obligation attached to the contract named, to guarantee its performance, or it may be the transfer of property or of other contracts to insure the' performance of the principal agreement.” See, also, Phillips on Mechanic’s Liens, Sec. 282-285. We feel entirely satisfied that the plaintiff did not take collateral security, and is not, therefore, deprived of the lien.
6_. when it attaches. Y. The contract under which the plaintiffs claim a mechanic’s lien was executed on the 6th day of August, 1870, and work thereunder commenced on the 29th day of September thereafter, and the work contracted to be done completed in December, 1872. On the first day of July, 1871, work under the contract to the value of upward of fifty thousand dollars had been done, and on said day the railway company executed the mortgage under which the defendant claims; for the purposes of this case the mortgage will be regarded as recorded on the day of its execution. There was no abandonment or cessation of} the work undertaken by the plaintiff until its completion. The question for determination is, which of these parties has the prior lien. Section 3139 of the Code provides that the lien of the mechanic shall have priority over all other liens or encumbrances made subsequent to the commencement of the building, erection or improvement. This case is clearly distinguishable from Neilson v. Iowa Eastern R. R., 44 Iowa, 71; and in Getchell v. Allen, 34 Iowa, 559, the mortgage was executed and recorded prior to the materials for which the lien was sought being furnished. The facts in this case, however, are in a legal sense identical with those in Jones v. Swan & Co., 21 Iowa, 181. It was held in that case that the lien of the mechanic “ attaches and is preferred to all other liens and encumbrances which become such subsequent to the commencement of the building, erection or improvement * * * . ” « The contract is treated as entire, all the items being furnished thereunder. Where there is a continuous open current account, the cause of action shall be deemed to have accrued as to all on the date of the last item. And so the mechanic’s lien attaches at the commencement of his work, and. the ninety days for notice commences on the date when *414all the work or things are furnished or performed.” With this ruling we are entirely content, believing the true and correct rule applicable to the facts in this case is therein enunciated.
The lien of the plaintiff is prior and superior to that of the defendant. Having thus noticed all the questions passed in argument by appellant, it only remains for us to announce that the judgment of the Circuit Court must be
Affirmed.
ON i REHEARING.
Day, Ch. J.
Upon the petition of appellant a rehearing was granted in this case. The case has been re-argued upon both sides, and is now again finally submitted for determination.
I. It is claimed that the court is in error in' stating in the former opinion that “ there was no evidence, by affidavit or otherwise, presented to the court, tending to support the allegations in the petition that Meyer and Dennison were citizens of some state other than Iowa.”
On the 6th day of April, 1874, the attorney of plaintiff filed an affidavit in the cause, stating “ that personal service of original notice in said suit cannot be made upon the defendants, John Edgar Thompson and William Dennison, trustees of certain bondholders of said railroad, within the state of Iowa, and they are non-residents of said state of Iowa.”
It is claimed that this affidavit furnished proof of a conclusive character that Meyer and Dennison were citizens of some other state than Iowa. To this position there are several answers: 1. The affidavit relates to a time more than one year prior to the time of filing the petition for transfer. Evidence that Dennison and Meyer were non-residents of Iowa on the 6th day of April, 1874, would not prove that they were such non-residents on the 19th day of May, 1875, when the petition for transfer was filed. 2. The affidavit merely states negatively that Meyer and Dennison do not reside in Iowa. It does not state affirmatively that they do reside in any other state of the United States. For aught that the affidavit shows *415tbey reside in some foreign country. 3. The affidavit says nothing of the citizenship of Meyer and Dennison; they are simply non-residents of Iowa, and, therefore, residents of some other state or country. But residence and citizenship are not synonymous terms, and a petition to remove a cause to the Federal court, which alleges that the parties reside in different states, is insufficient. Parker v. Overman, 18 Howard, 137.
II. Upon the main question discussed in the opinion, respecting the right of a state court to inquire into the truth of the facts alleged in the petition for a change of forum, we deem it unnecessary to add to what has already been said. We are satisfied with the conclusion reached in the foregoing opinion, and shall adhere thereto until the question is determined adversely by the court of ultimate resort. Our view derives at least indirect support from Holden v. Putnam Fire Insurance Co., 46 N. Y., 1, and Railway Company v. Ramsey, 22 Wallace, 322.