
567 P.2d 459 (1977)
Opal Laureen GROVES, Plaintiff and Appellant,
v.
Gerald Harvey GROVES, Defendant and Respondent.
No. 13566.
Supreme Court of Montana.
Submitted February 16, 1977.
Decided August 5, 1977.
*460 Peterson and Hunt, Kenneth D. Peterson argued, Billings, for plaintiff and appellant.
Berger, Anderson, Sinclair and Murphy, James J. Sinclair argued, Billings, for defendant and respondent.
HARRISON, Justice.
Plaintiff appeals from an order of the district court, Yellowstone County, denying her petition for permanent custody of her daughter, Renee, and granting permanent custody to defendant, the father of the child.
This litigation began April 17, 1973, when plaintiff filed for divorce in Billings, Montana. The parties were separated and defendant was living in Alberta, Canada at the time. Defendant had physical custody of the child in accordance with the wishes of both parties. On May 18, 1973, defendant obtained an ex parte order from the Alberta court granting him legal custody. On June 4, 1973, plaintiff was awarded the divorce and custody of the child by default in the Montana proceeding.
Thereafter, the parties agreed defendant should have custody of Renee with liberal visitation rights granted to plaintiff. Pursuant to stipulation, decrees were entered in the Alberta court on September 27, and in the Montana court on October 9, granting custody to defendant. This arrangement lasted until the summer of 1974, when plaintiff, who had the child in Montana for visitation, filed an affidavit and petition for modification of custody. This was filed on August 14, 1974, the day before defendant was to arrive in Billings to pick up the child. The affidavit stated plaintiff had remarried to Dr. Walter Francke and that she and Dr. Francke would "provide a secure and loving home" for Renee. On the basis of this affidavit, the court granted temporary custody to plaintiff and ordered defendant to appear on August 21 for a hearing to show cause why such custody should not be made permanent. Defendant was served with this order when he arrived in Billings to pick up the child.
The show cause hearing was held August 21 in chambers. While there is no record of what transpired, apparently no testimony was taken. The court was concerned about the parties' tendencies to obtain ex parte orders in different jurisdictions and desired that the parties agree to a single forum for an adjudication binding in Montana and Canada. As a result of this hearing the court ordered: (1) "that the hearing on the Order to Show Cause shall be continued indefinitely to be reset at a later date at a time convenient to Court and Counsel," and (2) "that temporary custody of the minor child * * * shall remain with Plaintiff * * * until further order of this Court."
*461 This temporary arrangement was still in effect March 18, 1975, when plaintiff filed another affidavit and petition for permanent custody. Defendant filed a similar affidavit and petition February 4, 1976, alleging plaintiff and Dr. Francke had exposed the child to constant fighting and violence arising out of the excessive use of alcohol. Defendant further stated he was remarried and in a position to offer the child an excellent family situation.
A full hearing on the petitions of both parties was held April 5, 1976. On May 3, at the direction of the district court, the parties entered into a stipulation whereby they agreed to be bound by the order of the district court and to apply to the Canadian court for a consent order in conformity thereto. On May 19, 1976, the court ordered plaintiff's petition for custody be denied and defendant's petition for custody be granted.
Four issues are presented on appeal:
1. Did plaintiff waive her right to appeal by stipulating that she would be bound by the order of the district court?
2. Was defendant's petition for custody barred by section 48-339, R.C.M. 1947, which prohibits, absent special circumstances, any motion to modify a custody decree within two years after its date?
3. Did the district court err in granting custody to defendant in light of the evidence presented?
4. Did the court err in its refusal to admit the deposition of one Mlora Smith MacKay into evidence at the April 5 hearing?

Issue 1.
Before the district court made its final order the parties entered into a "STIPULATION FOR ENTRY OF A CONSENT ORDER". It provided:
"The Parties hereto, OPAL LAUREEN FRANCKE, f/k/a OPAL LAUREEN GROVES, individually, by and through her attorney * * * and GERALD HARVEY GROVES, individually, by and through his attorney * * * stipulate and agree that they shall be bound by the Order, Judgment and Decree entered by this Court in this matter, regardless of the jurisdiction in which they reside, and further, that application shall be made to the trial division of the Supreme Court of Alberta, Judicial District of Calgary, for a Consent Order to conform all legal proceedings therein involving the Parties hereto and their child, RENEE ADELE GROVES, to the Order, Judgment and Decree of this Court. The Parties further stipulate and agree that they will sign and execute any and all documents and papers necessary to secure said Consent Order."
This stipulation was made at the direction of the district judge, who was seeking to resolve the jurisdictional conflict. While it is possible to waive any errors and give up any right of appeal in Montana, the general rule is as stated in 4 Am.Jur.2d, Appeal and Error § 236 p. 733:
"Such an agreement should be very clear on its terms, and leave no doubt of the intention of the party to cut himself off from the right of appeal. * * *"
Here the stipulation was made before the district court made its decision and both parties agree the overriding purpose of the stipulation was to end the jurisdictional problems which had plagued this case since 1973.
Although the parties clearly agreed to be bound by the order of the district court, it was not clear whether the order referred to was before appeal, or after either an appeal was taken or the time for appeal lapsed. Certainly, the language of the stipulation does not amount to a clear showing the parties intended to preclude any right of appeal. Accordingly, we hold the stipulation did not prevent the parties from taking an appeal, but merely bound them by the final order of the district court, as the case is finally resolved.

Issue 2.
Section 48-339, R.C.M. 1947, provides:

*462 "(1) No motion to modify a custody decree may be made earlier than two (2) years after its date, unless the court permits it to be made on the basis of affidavits that there is reason to believe the child's present environment may endanger seriously his physical, mental, moral, or emotional health.
"(2) The court shall not modify a prior custody decree unless it finds, upon the basis of facts that have arisen since the prior decree or that were unknown to the court at the time of entry of the prior decree, that a change has occurred in the circumstances of the child or his custodian, and that the modification is necessary to serve the best interest of the child. In applying these standards the court shall retain the custodian appointed pursuant to the prior decree unless:
"(a) the custodian agrees to the modification;
"(b) the child has been integrated into the family of the petitioner with consent of the custodian; or
"(c) the child's present environment endangers seriously his physical, mental, moral, or emotional health, and the harm likely to be caused by a change of environment is outweighed by its advantages to him.
"(3) Attorney fees and costs shall be assessed against a party seeking modification if the court finds that the modification action is vexatious and constitutes harassment."
Plaintiff received temporary custody based on her August 14, 1974 affidavit and petition for change of custody. On August 22, the district court held a hearing on the order to show cause and ordered: (1) that temporary custody be left with plaintiff; and (2) that the hearing be continued indefinitely. This order, plaintiff argues, amounted to a "custody decree" within the meaning of section 48-339, thus leaving the court without jurisdiction to change custody for two years, absent a showing of special circumstances. Holm v. Holm, Mont., 560 P.2d 905, 34 St.Rep. 118. However, we do not agree the August 22, 1974 order was ever intended to be a final custody decree. It arose out of an in-chambers hearing at which no testimony on the merits of the custody issue was taken. In its memorandum with the final order of May 19, 1976, the district court expressed its rationale for the August 22, 1974 order:
"* * * Because of the way the parties were using the Montana and Alberta courts in ex parte proceedings, the hearing was continued pending resolution of which court the parties could agree upon for jurisdiction since the allegations before the Montana court stated that an application for court action was also pending in Calgary. As a consequence, the child has remained with the mother * * *".
Clearly the August 22, 1974 order was intended to be interlocutory in nature; express the court's continuing jurisdiction; and hold the matter in abeyance until the jurisdictional difficulties could be resolved. The custody issue was merely left alone for the moment. A temporary custody order is not equivalent to a custody decree within the meaning of section 48-339. To hold otherwise would be to defeat the purpose of a temporary order. Here, it is peculiar that the temporary custody order remained in effect for one and one-half years, but this does not change the fact it was granted ex parte and was never intended to be a final custody decree. Thus defendant's petition for custody was not barred by section 48-339. The last "custody decree" was entered in Montana October 9, 1973, and that decree granted custody to defendant. In reality, then, it is plaintiff who is seeking modification of a custody decree under section 48-339.

Issue 3.
Our reasoning in Issue 2 applies to the issue of whether the district court erred in granting custody to defendant. To modify the custody decree of October 9, 1973, it is plaintiff who must meet the provisions of section 48-339. It is plaintiff's responsibility to prove that modification is necessary to serve the best interests of the child, and to do so she must satisfy one of the conditions *463 specified in subsections (a), (b) and (c), section 48-339(2).
Subsection (a) does not apply because defendant never agreed to a modification.
Subsection (b) does not apply because, while it is arguable the child has been integrated into plaintiff's family for one and one-half years, it was not with the consent of defendant.
Therefore, in order to be entitled to a modification, plaintiff must prove that under subsection (c):
"the child's present environment endangers seriously his physical, mental, moral, or emotional health, and the harm likely to be caused by a change of environment is outweighed by its advantage to him."
In the unique context of this case, in which the noncustodial parent was awarded temporary custody, "present environment" must be taken to mean the environment of the child while with the parent who held the child under the prior decree and before custody was temporarily taken from him.
Generally, the evidence brought forth on plaintiff's behalf was that the child was well cared for and has undergone normal development while in plaintiff's temporary custody, and plaintiff has shielded the child from much of the trouble encountered in her stormy marriage with Dr. Francke. Plaintiff also attempted to show that her lifestyle has changed since this marriage and that she no longer drinks and is an active member of the Mormon Church. There is, however, no evidence the child was anything but well-adjusted while she lived with defendant, and there is certainly no evidence her physical, mental, moral, or emotional health was in danger. On the contrary, the evidence shows defendant has provided and is in a position to continue to provide an excellent home for the child. Matters of child custody are within the discretion of the district court, and under these circumstances we cannot say the district court abused its discretion in awarding custody to defendant. Gilmore v. Gilmore, 166 Mont. 47, 530 P.2d 480.
To prevent just the sort of ping-pong custody litigation that has occurred in the instant case, section 48-339 places a heavy burden on the person seeking to modify a prior custody decree. Plaintiff has not met this burden and cannot shift it to defendant by an ex parte, temporary order of custody.

Issue 4.
Plaintiff argues the court erred in refusing to admit into evidence the deposition of Mlora Smith MacKay. The circumstances surrounding the taking of this deposition are:
The parties stipulated defense counsel would take plaintiff's deposition at a certain time. At the conclusion of this deposition, counsel for plaintiff announced, for the first time, that he planned to take the deposition of Mlora MacKay immediately, as she lived in Canada, was in Montana visiting her family, and planned to return to Canada right away. Counsel asked if counsel for defendant would stipulate this was a deposition for the perpetuation of her testimony, but counsel for defendant refused to so stipulate. The deposition was taken with counsel for defendant present, who asked a few questions of MacKay regarding the notice she had that her deposition was going to be taken. At the hearing, the district court refused to allow the deposition into evidence.
Although there was no stipulation regarding the deposition and no notice at all of its taking until the deposition was about to be taken, plaintiff argues it should have been admitted because defendant filed no written objection to the lack of notice. Rule 32(d)(1), M.R.Civ.P., provides:
"As to notice. All errors and irregularities in the notice for taking a deposition are waived unless written objection is promptly served upon the party giving the notice."
However, this is not a case of a technical error or irregularity in notice, it is a case of no notice at all. We cite with approval this statement from 4A Moore's Federal Practice, ¶ 32.09:
"Depositions should not be admitted where they are taken without giving the *464 adverse party reasonable notice of the taking and there is no opportunity for a protective order."
Here there clearly was no notice of the deposition and no opportunity for counsel for the defendant to move the court for a protective order; the deposition was going to be taken immediately. It was impossible for defense counsel to prepare any effective cross-examination of the witness, and the admission of such deposition into evidence at the trial would be unfair and prejudicial to defendant. The district court did not commit reversible error by excluding it.
The order of the district court granting custody of the child to defendant is affirmed.
HATFIELD, C.J., and DALY and SHEA, JJ., concur.
HASWELL, Justice, specially concurring:
I concur in the result, but not in all that is said in the discussion of the second issue in the opinion.
