ORDER
Leandra Davis pleaded guilty pursuant to a written plea agreement to conspiracy to distribute and possess with intent to distribute in excess of 1 kilogram of heroin, 10 kilograms of cocaine, and 100 kilograms of marijuana. 21 U.S.C. §§ 846 and 841(a)(1). He was sentenced to 162 months’ imprisonment. Davis filed a notice of appeal, but his newly appointed appellate counsel seeks to withdraw under Anders v. California, 386 U.S. 738, 87 S.Ct. 1396, 18 L.Ed.2d 493 (1967). We notified Davis of counsel’s motion and he has filed a response. Having reviewed counsel’s brief. Davis’s response, and the relevant portions of the record, we agree with counsel that the potential issues identified are frivolous.
*246Counsel first considers whether Davis could challenge his guilty plea as not knowing and voluntary. As counsel correctly concludes, however, such an argument would be frivolous because the district court substantially complied with Rule 11 of the Federal Rules of Criminal Procedure. After determining that Davis was competent to enter a plea, the district court advised him of the nature of the charge, the possible penalties, and the various rights he would waive by pleading guilty. In response to the district court’s questioning. Davis represented that he had not been coerced into pleading guilty and that no other promises or agreements had been made. We presume those representations to be truthful. Bridgeman v. United States, 229 F.3d 589, 592 (7th Cir. 2000). The court also determined that an adequate factual basis for the plea existed. Although the court did not specifically review with Davis the sentencing appeal waiver contained in the plea agreement. Davis testified under oath that he had reviewed and signed the plea agreement. See United States v. Driver, 242 F.3d 767, 769 (7th Cir.2001). And even though Davis did express some reservations about pleading guilty near the end of the plea colloquy, the court immediately took a recess so that Davis could confer with his counsel. After doing so. Davis reaffirmed his intention to plead guilty, and the district court thoroughly questioned him again to ensure that his plea was knowing and voluntary.
Relatedly, counsel assesses whether Davis could argue that the district court erred in denying his pro se motion to withdraw his plea. In that motion Davis alleged that his plea was involuntary because the government and his then-counsel had coerced him into pleading guilty. Davis argued, for example, that during a proffer with the government, he had been promised a five-year prison term. As we noted above, however, the district court conducted a proper Rule 11 colloquy and ascertained that Davis’s plea was knowing and voluntary. See United States v. Stewart, 198 F.3d 984, 987 (7th Cir.1999) (“A defendant’s protestation that statements freely made under oath when entering the plea were a pack of lies is not a ‘fair and just reason’ to start anew.”). In denying the motion to withdraw, the district court credited Davis’s statements given under oath, and we are not at liberty to second-guess the court’s credibility determinations. See id. Moreover, Davis makes no assertion in his response to counsel’s Anders motion that he should have been permitted to withdraw his plea.
Counsel also evaluates whether Davis could argue that his plea was invalid because he was illegally detained while awaiting trial, and Davis seeks to argue directly that his pretrial detention was illegal. In either case, we agree with counsel that in this appeal it would be frivolous for Davis to challenge his pretrial detention. Any issue regarding the legality of Davis’s pretrial detention became moot once he pleaded guilty, see Murphy v. Hunt, 455 U.S. 478, 481-82, 102 S.Ct. 1181, 71 L.Ed.2d 353 (1982) (per curiam); United States v. O’Shaughnessy, 772 F.2d 112, 113 (5th Cir.1985) (per curiam), and an illegal detention is not a basis for invalidating a guilty plea, see Gerstein v. Pugh, 420 U.S. 103, 119, 95 S.Ct. 854, 43 L.Ed.2d 54 (1975).
Lastly, counsel and Davis consider whether he could raise a nonfrivolous challenge to his sentence. In particular, counsel addresses whether Davis could argue that the district court erred in calculating his base offense level and criminal history category, in increasing his offense level by three under U.S.S.G. § 3Bl.l(b) for his role as a manager or supervisor, and in *247denying a motion for a downward departure based on diminished capacity. But, as counsel notes, Davis’s plea agreement contains a sentencing appeal waiver, which reads in relevant part:
Defendant further understands he is waiving all appellate issues that might have been available if he had exercised his right to trial, and only may appeal the validity of his plea of guilty or the sentence. Acknowledging all of this, the defendant knowingly waives the right to appeal his sentence on the grounds set forth in Section 3742 or on any ground whatever, in exchange for the concessions made by the United States in this plea agreement.
While the first sentence of the waiver, when read alone, indicates that Davis preserved the right to appeal his sentence, the second sentence indicates that such right is limited and encompasses the sentencing guidelines challenges counsel and Davis discuss. Although counsel suggests that the waiver might be viewed as ambiguous, we are not inclined to view it as such because Davis makes no assertion in his response to counsel’s Anders motion that the waiver is invalid or that he did not understand its scope.
Sentencing appeal waivers are presumed valid where the underlying plea is valid. United States v. Wenger, 58 F.3d 280, 282 (7th Cir.1995), and will be enforced unless the sentence exceeded the statutory maximum or was based on a constitutionally impermissible factor, Jones v. United States, 167 F.3d 1142, 1144 (7th Cir.1999). Here, Davis’s plea was valid, his sentence did not exceed the statutory maximum, and there is no suggestion in the record that his sentence was based on a constitutionally impermissible factor. Moreover, we note that even if we were to determine that the sentencing appeal waiver is ineffective because it is ambiguous, we nonetheless would conclude that the potential sentencing issues identified by counsel and Davis are frivolous.
Counsel’s motion to withdraw is GRANTED and the appeal is DISMISSED.