Granger, J.
*1361 *1372 3 *135The action is to foreclose a mortgage given by L. W. Goode on real estate in the city of Des Moines, to secure the sum of sixteen thousand dollars, with interest. Prior to the commencement of this action, the real estate was conveyed to the Avenue Investment Company. The following is a provision of the mortgage: “In case of a foreclosure of this mortgage, under any of its provisions, it is hereby agreed that, on filing the petition for such foreclosure, a receiver shall be appointed to take charge of the mortgaged premises at once, and to hold possession of *136the same until the debt is fully paid and the time of redemption expires, and all rents and profits derived from said premises shall be applied on the debt secured hereby.” The plaintiff, on the filing of the petition, asked for the appointment of a receiver, and, upon a showing made, a receiver was appointed. A judgment was entered for plaintiff for the amount due on the note against L. W. Goode and the Avenue Investment Company, which had assumed payment of the notes in its purchase, and a decree was entered for the sale of the real estate. The decree also continued the appointment of the receiver until the debt was paid, or during the period of redemption. The question for our consideration is as to the validity of the order continuing the receiver. The showing for the continuance of the receiver, aside from the stipulation in the mortgage, was by affidavit, of which the plaintiff filed six, each fixing the value of the property at fifteen thousand dollars. The defendant filed eight affidavits, in which the value was fixed at from thirty-three thousand dollars to thirty-five thousand dollars. The mortgage was given to secure a part of the purchase price of the property, the purchase price being nineteen thousand dollars. The amount of the judgment entered was seventeen thousand, six hundred and thirty-three dollars and eighty-three cents. The land had been sold for the taxes of 1892, and the amount was included in the judgment. The defendant, Goode, is conceded to be insolvent, but. there is no showing as to, the investment company that had assumed payment of the notes. It will be seen that it was a matter of dispute, and, we think, of doubt, whether the property would be sufficient to pay the judgment, independent of the rents and profits, which were pledged as part of the security. Appellants’ main contention against the action of the court is based on section 2908 of the Code, which is a *137provision reciting facts and conditions under which the court may appoint a receiver to take charge of and control property, under .its direction, “during the pendency of the action”; and it is claimed that the action is pending, within the meaning of the section, only till the judgment is entered. We think a controlling fact in the case is the contract of the parties. The section permits this appointment, independent of the agreement of the parties, if the facts exist under which such an appointment is authorized. There is nothing in the section to restrict the right of parties, pending an action, to stipulate for the appointment of a receiver, or of the court to appoint one on such stipulation. -Nor is there anything in the section intended to deny any right to the court or to the parties, as to a receiver, that would have existed had the section not been adopted. Now, we think it is not to be seriously questioned that, without the section, the court could, by a stipulation of the parties, place the property in the hands of a receiver, to be held under its direction. And it seems to us equally clear that the parties could, by contract, when the property was pledged as security, settle the conditions on which it should be preserved ,and applied. The parties, in making .the contract, seem to have been in such doubt, as to the sufficiency of the property as security, as to provide that if proceedings to foreclose should be commenced, a receiver should take the rents and profits, and apply them, and otherwise preserve the property, under the direction of the court. We see nothing in such a contract that is unconscionable, or against public policy; nor do we see why it should not be enforced as the parties intended. The investment company took the property burdened with the incumbrance and its conditions. The judgment is' affirmed.