Robinson, J.
— The correctness of the decision of the district court in sustaining the demurrer is presented to us for review by means of various questions of law certified by the trial judge. Among these are the following : “(1) Was the order of default and forfeiture of the security or deposit money, at the November term, 1886, of the district court, final and conclusive, not having been set aside or modified by the court at that time % (2) Did said order of forfeiture of itself, without further order of the court, operate to carry the deposited fund into the county treasury, for the use of the school fund ? (8) Had the district court power, at the January term, 1887, to set aside the default and forfeiture entered at the November term, 1886 ? (4) Had the board of supervisors any authority or power to direct and require the clerk to pay said money security into the county treasury, and thereby place the fund out of the control of the district court, and deprive the plaintiff of the same, under and by virtue of the mere- order entered for default and forfeiture by the district court ?” The theory upon which the demurrer was sustained seems to be that the district court had no authority to set aside the default and forfeiture after the term at which they were entered ; that its action at the January term following was void; that the right of the temporary school fund to' the amount forfeited became vested and indefeasible when the November, 1886, term of court was adjourned. Appellee insists that such was the case, and cites sections 4596 and 4597 of the Code, in support of its claim. These sections are as follows: “Section 4596. If the defendant fail to appear for arraignment, trial or judgment, or at any other time when his personal appearance in court may be lawfully *194required, or to surrender himself in execution of the judgment, the court must direct an entry of such failure to be made on the record, and the undertaking of his bail, or the money deposited instead of bail, as the case may be, is thereupon forfeited.” “Section 4597. If, before the final adjournment of the court for the term, the defendant appear and satisfactorily excuse his failure, the court may direct an entry to be made on the record that the forfeiture of the undertaking or deposit be discharged.” Sections 4598 and 4600 are as follows : “ Section 4598. If the forfeiture is not discharged, the district attorney may, at any time after the adjournment of the court for the term, proceed by civil action only upon the undertaking of the bail. ” “ Section 4600. If, before judgment is entered against the bail, the defendant be surrendered or arrested, the court may, in its discretion remit the whole or any part of the sum specified in the undertaking.” The primary object for which bail is taken in cases like that under consideration is to secure the personal attendance of the defendant when it is desired, and to avoid the necessity of keeping him in custody. Money may be deposited in lieu of bail, but it is received for the same purpose. It is true that it may be appropriated to pay the judgment in certain cases. Code, sec. 4592. It is supposed to be the property of the defendant, and since he is in court, he is bound by orders made in regard to it. But there is no more reason for refusing to discharge the forfeiture as to the money, where the default of the defendant is satisfactorily excused, than there would be for refusing to discharge the undertaking of bail, unless it is beyond the power of the court to discharge it. This is especially true when, as in this case, the money is not deposited by the defendant, but by another. The effect of the default entered under section 4596 of the Code was not to accomplish an immediate transfer of the amount forfeited to the school fund. Under section 4597, the court might at any time before its final adjournment for the term, upon the appearance of the defendant, and the due excuse of his default, discharge *195the forfeiture. If the deposit of money had passed beyond the control of the court by virtue of the entry of default, the order of discharge as to that would be without effect. But that, evidently, was not the intent of the general assembly. Section 4598 authorizes the district (now county) attorney to proceed by civil action upon the undertaking of bail after the adjournment of court for the term, where the forfeiture is not discharged. A consideration of sections 4596-4598 leads to the conclusion that the entry of default did not of itself operate as a transfer of the money to the school fund; that the right to discharge the forfeiture upon the appearance of the defendant, and the satisfactory excuse of the default, was absolute in the court during the term at which the default was entered, and that no right of action in favor of the school fund became vested until after the adjournment of such term. But even then the right of recovery on the undertaking of bail is not absolute. Section 4600 gives a discretion to the court to remit the whole or any part of the amount of the undertaking before judgment, in case the defendant is taken into custody. These various provisions of the law are evidently designed to secure a hearing and disposition on its merits of the charge against the defendant, and the enforcement of any judgment which may be rendered against him. The giving of bail, and the depositing of money in lieu of bail, are auxiliary to the main case. This being true, it follows that the money so deposited should remain subject to the control of the court until the case is finally determined, unless it has been previously disposed of by order of the court, or by the defendant, in the manner authorized by law. In this case,, as we have seen, the entry of default did not operate to transfer the money to the school fund, and no order for such transfer was made by the court. The demurrer admits that the default was set aside, and the forfeiture discharged, at the January, 1887, term, upon a sufficient showing. The facts set out in the petition show that the case could not have been disposed of on its merits prior to the setting aside of the default, and that *196tb.e defendant must have appeared in order to have the default set aside and the forfeiture discharged. There is nothing in the sections of the Code quoted, and nothing in any other provisions of the law, to which onr attention has been called, which forbids the discharge of the forfeiture alleged in this case, while it would be in harmony with the evident policy of the law to allow it. The district court should be held to have power to review and change its rulings and orders made during a criminal as well as during a civil cause, in the furtherance of justice. In this case we must presume that the court found, upon the showing made; that the entry of default and forfeiture was erroneous, or that the purpose of the case would be promoted by setting it aside. It follows, from what we have said, that, under the facts shown by the petition, the money in question was never legally transferred to the school fund, and that it should be refunded. The judgment of the district court is therefore Reversed.