DECISION
LEONARD, Judge:Appellant pleaded guilty to and was convicted of three offenses of willful disobedience of a “safe sex” order of his commander. On appeal, he asserts that the military judge erred by failing to direct one-for-one confinement credit for his pretrial confinement. Additionally, in a submission pursuant to United States v. Grostefon, 12 M.J. 431 (C.M.A.1982), appellant maintains that he did not freely enter into the pretrial agreement in his case and his guilty plea was improvident because the “safe sex” order was an unlawful order. On the issue of unlawfulness of the order, he asks that we consider two written motions by his trial defense counsel that are attached to his record of trial as part of Appellate Exhibit II. In those motions, the trial defense counsel asserted appellant’s “safe sex” order was unlawful because it was an excessive intrusion on personal rights and was only given to subject the appellant to increased punishment for violation of an *928already existing duty chargeable under Article 92, UCMJ, 10 U.S.C. § 892. We find' no merit in any of appellant’s assertions.
No error was committed with respect to appellant’s pretrial confinement credit. Confinement authorities apply the day-for-day credit for pretrial confinement and no direction by the military judge is required. Air Force Regulation 111-1, Military Justice Guide, paragraph 15-2c, (Sep. 1988). Military judges direct credit only for illegal pretrial confinement. R.C.M. 305(j)(2).
In his Grostefon submission, the appellant asserts he was pressured into giving up the right to contest the lawfulness of his “safe sex” order and into accepting a pretrial agreement and pleading guilty. The record does not support appellant’s claims.
Before pleas were entered, appellant’s civilian trial defense counsel stated he would raise two motions concerning the lawfulness of appellant’s “safe sex” order and written motions were submitted and included in Appellate Exhibit II. Shortly thereafter, the trial was interrupted to obtain the approval of the convening authority on a defense proposed pretrial agreement. Before the pretrial agreement was finalized, there was further discussion on the record concerning the lawfulness of the order, a defense request to call an expert witness on this question, and whether a guilty plea would waive any motions dealing with lawfulness of the order. After a pretrial agreement was obtained, the defense counsel stated that he would not litigate any issues concerning unlawfulness of the “safe sex” order. Appellant then entered an unconditional guilty plea to all three offenses alleging willful violation of this order. -
Reviewing the entire record of trial, we find no support for appellant’s assertion that he did not freely enter into his pretrial agreement or voluntarily plead guilty. The military judge was extremely thorough in his inquiry into the providency of appellant’s guilty pleas and the voluntariness of both his guilty pleas and his initiation of and willingness to enter into the pretrial agreement. Further, because the issue of unlawfulness of the order had been touched upon earlier, the military judge also inquired thoroughly into the appellant’s understanding of the lawfulness of the order. During that inquiry, the appellant agreed the order was lawful and that he had a duty to obey it. Appellant was very ably defended by a civilian defense counsel and an appointed military defense counsel. Both counsel were very actively involved on appellant's behalf in all stages of his defense from the Article 32, UCMJ investigation through submission of matters to the convening authority. There is no indication in the record of ineffective assistance of counsel or that appellant was in anyway pressured into pleading guilty or entering into the pretrial agreement. Absent such indications appellant is not entitled to have either his guilty pleas or pretrial agreement set aside.
The trial defense counsel’s unlitigated motion that the “safe sex” order was unlawful because it was given to subject appellant to increased punishment was actually a complaint of defective charging. The thrust of the motion was that the violation of the “safe sex” order should have been charged as a violation of a general regulation or order under Article 92, UCMJ rather than a willful disobedience of a superior commissioned officer under Article 90, UCMJ, 10 U.S.C. § 890. Failure to raise this issue before entering pleas waived it. R.C.M. 905(b)(2). Even if the issue were not waived, it had no merit. The defense motion contended that the order given appellant by his squadron section commander merely reinforced previous “safe sex” orders appellant had been given by other personnel and therefore was only given to subject him to increased punishment. This contention ignores the fact that the previous “safe sex” orders were individual orders given to appellant by medical personnel who were also Air Force commissioned officers. The violation of these orders could also have been charged under Article 90, UCMJ. MCM, Part IV, paragraph 13c(l)(a) (1984). The mere fact one of these orders stated that violation of the order “may result in ... punishment under the UCMJ, Article 92,” did not require the government to prosecute only *929under that article. The obvious purpose of the statement was to warn recipients of the order that they would be subject to punishment under the UCMJ for violation of the order and not to limit the way the offense could be charged.
Appellant’s unconditional guilty plea also waived the issue that the “safe sex” order was unlawful as an excessive intrusion on personal rights. R.C.M. 910(j); United States v. Dumford, 28 M.J. 836 (A.F.C.M.R.1989). Further, applying the rationale of Dumford and United States v. Womack, 27 M.J. 630 (A.F.C.M.R.1988), aff'd 29 M.J. 88 (C.M.A.1989), we believe appellant’s “safe sex” order had a valid military purpose and was lawful. In appellant’s case, the uninformed or unprotected sex that violated the order was with one partner who was another Air Force member and two others who were dependent wives of Air Force members. All three individuals were entitled to medical care from military medical facilities and had the potential for further sexual activity with other military members. The valid military purpose of appellant’s order was to prevent the spread of a deadly, contagious disease and by doing so safeguard the health of members of the Air Force to insure their ability to perform Air Force missions. That military purpose was valid with respect to uninformed or unprotected sexual activities with all three of the women involved in appellant’s offenses.
Having examined the record of trial, the assignment of errors, appellant’s submission pursuant to United States v. Grostefon, 12 M.J. 431 (C.M.A.1982), and the government’s reply, we conclude that the findings and sentence are correct in law and fact and that no error materially prejudicial to the substantial rights of the accused was committed. Accordingly, the findings of guilty and sentence are
AFFIRMED.
Senior Judge FORAY and Judge MURDOCK concur.