
128 P.3d 1 (2005)
2005 UT App 496
STATE of Utah, Plaintiff and Appellant,
v.
Rey de la Cruz LOPEZ, Defendant and Appellee.
No. 20040816-CA.
Court of Appeals of Utah.
November 17, 2005.
*2 Mark L. Shurtleff, Atty. Gen., Karen A. Klucznik, and Richard G. Hamp, Asst. Attys. Gen., Salt Lake City, for Appellant.
Debra M. Nelson, Salt Lake City, Salt Lake Legal Defenders Ass'n, for Appellee.
Before BILLINGS, P.J., BENCH, Associate P.J., and THORNE, Jr., J.

OPINION
BILLINGS, Presiding Judge:
¶ 1 The State appeals the trial court's sua sponte order withdrawing Defendant Rey de la Cruz Lopez's guilty pleas to two counts of forgery, third degree felonies, in violation of Utah Code section 76-6-501. See Utah Code Ann. § 76-6-501 (1999). We affirm.

BACKGROUND
¶ 2 In April 1999, Defendant presented an invalid social security number and a counterfeit residency card in order to secure a United States Department of Housing and Urban Development guaranteed home loan. Defendant was charged with one count of forgery, a third-degree felony, and one count of communications fraud, a second-degree felony, or in the alternative, one count of theft by deception, a second-degree felony.
¶ 3 On August 19, 2004, Defendant entered into a plea agreement with the State whereby the State agreed to amend the communications fraud count to a count of forgery, and Defendant agreed to plead guilty to two counts of forgery.
¶ 4 Because Defendant spoke Spanish, the trial court conducted a plea colloquy with Defendant through an interpreter. The trial court asked Defendant if he had reviewed the Statement of Defendant in Support of Guilty Plea (Plea Statement). Through his interpreter, Defendant acknowledged that he had. The trial court also asked whether the Plea Statement was printed in Spanish. Defense counsel indicated that while the Plea Statement was in English, he had gone through it very carefully with Defendant. The trial court questioned defense counsel as to why the Plea Statement was not printed in Spanish. Defense counsel answered that although he had a Spanish form available, he mistakenly filled out the English form, which is why he went through it in detail with Defendant. The State also indicated that it observed defense counsel taking a significant amount of time to ensure that Defendant understood the Plea Statement.
¶ 5 Defendant pleaded guilty to both counts of forgery, and the trial court accepted Defendant's guilty pleas. Defense counsel indicated that he had discussed sentencing with Defendant, and that it was Defendant's desire to waive the minimum time for sentencing. Defense counsel then requested that sentence be imposed immediately and that Defendant be released to immigration officials (INS) for deportation to Mexico. The trial court asked Defendant whether he understood that (1) if he was sentenced immediately, he would give up his right to withdraw his guilty plea, and (2) if he was released to INS, he would be prohibited from reentering the United States without INS's permission. Through his interpreter, Defendant responded affirmatively to both questions. The trial court then imposed two concurrent sentences of zero to five years in Utah State Prison, which the trial court stayed, placed Defendant on probation, and authorized his release to INS.
¶ 6 The trial court never entered a final order of judgment. Rather, in the change of plea minute entry dated the same day, the trial court sua sponte reconsidered the acceptance *3 of Defendant's plea. The trial court stated, "Based upon information brought to the [c]ourt, the court sets aside [D]efendant's plea in this matter. Plea is stayed pending a hearing in this matter."
¶ 7 On August 23, 2004, the trial court held a hearing on the matter. The State indicated to the trial court that it was not sure of the current status of the case and the trial court responded,
The current status is ... that ... the record will indicate that [Defendant] entered a plea to two third degree felonies, forgery charges. It's been brought to the [c]ourt's attention  in fact we discussed this at the time that the [P]lea [Statement] itself was in English and not in Spanish. [Defendant] is not fluent in English. This form was translated for him, but based upon information the [c]ourt received, I have serious concerns that [Defendant] understands the ramifications of what he is doing and what a plea to these charges means to him.
¶ 8 The trial court then set aside Defendant's pleas and allowed him a week to decide whether he wanted to proceed with a change of plea. The trial court directed defense counsel to present a Plea Statement printed in Spanish to Defendant. The State appeals the trial court's sua sponte withdrawal of Defendant's plea.

ISSUE AND STANDARD OF REVIEW
¶ 9 The State argues that the trial court did not have jurisdiction under Utah Code section 77-13-6 (plea withdrawal statute) to withdraw Defendant's guilty pleas after sentence was announced. See Utah Code Ann. § 77-13-6 (Supp.2005). Whether the trial court has subject matter jurisdiction presents a question of law that we review for correctness. See Beaver County v. Qwest, Inc., 2001 UT 81, ¶ 8, 31 P.3d 1147. Similarly, "[b]ecause the interpretation of a statute presents a question of law, we review for correctness." State v. Amador, 804 P.2d 1233, 1234 (Utah Ct.App.1990).

ANALYSIS

I. The State's Right to Appeal
¶ 10 As a preliminary matter, Defendant asserts the State may not appeal the trial court's sua sponte order to set aside his guilty pleas. The State argues that it has a statutory right under Utah Code section 77-18a-1 to appeal the trial court's order. See Utah Code Ann. § 77-18a-1 (2003). We agree with the State.
¶ 11 Utah Code section 77-18a-1 sets forth a narrow set of specific judgments and orders from which the State may appeal. See id.; Amador, 804 P.2d at 1234. "To determine whether an appeal falls within one of the statutorily enumerated grounds, we look to general rules of statutory construction." Amador, 804 P.2d at 1234. "[O]ur primary goal in interpreting statutes is to give effect to the legislative intent, as evidenced by the plain language, in light of the purpose the statute was meant to achieve." State v. Burns, 2000 UT 56, ¶ 25, 4 P.3d 795.
¶ 12 The statute provides, in relevant part, "[a]n appeal may be taken by the prosecution from ... an order of the court granting a motion to withdraw a plea of guilty or no contest." Utah Code Ann. § 77-18a-1(2)(g). Defendant argues that this provision only allows the State to appeal a trial court's grant of a defendant's motion to withdraw. However, there is nothing in the plain language of this statute that limits its application to only motions filed by a defendant.
¶ 13 In addition, Defendant provides no rational explanation as to why the legislature would limit the State's right to appeal to only those cases where a defendant instituted the withdrawal motion. We agree with the State that the intent of the legislature by enacting this statute is to protect the finality of criminal convictions by providing the State with a mechanism to challenge a trial court's ruling that upsets such convictions. Furthermore, the State's interest in appealing from a trial court's sua sponte order withdrawing a guilty plea is substantial because of the potential double jeopardy implications. See, e.g., State v. Bernert, 2004 UT App 321, ¶ 8 n. 1, 100 P.3d 221 (noting that in Utah, jeopardy attaches once a trial court accepts a guilty plea *4 and thus a trial court's sua sponte withdrawal of a plea could possibly preclude retrial absent a showing of "manifest necessity"). Accordingly, we hold that the State has a statutory right to appeal the trial court's sua sponte withdrawal of Defendant's guilty pleas.

II. Plea Withdrawal Statute
¶ 14 Prior to May 5, 2003, the plea withdrawal statute provided that "[a] request to withdraw a plea of guilty ... shall be made within 30 days after the entry of the plea." Utah Code Ann. § 77-13-6(2)(b) (1999). After some confusion in the case law regarding when the statute begins to run, the Utah Supreme Court ruled that "the thirty-day [time] limit for filing a motion to withdraw a guilty plea found in section 77-13-6(2)(b) of the Utah Code begins to run at the time the district court enters final judgment" and not "from the date of the plea colloquy." State v. Ostler, 2001 UT 68, ¶ ¶ 11, 13, 31 P.3d 528.
¶ 15 After Ostler, the Utah Legislature amended the plea withdrawal statute to provide that "[a] plea of guilty ... may be withdrawn only upon leave of the court and a showing that it was not knowingly and voluntarily made.... A request to withdraw a plea of guilty ... shall be made by motion before sentence is announced." Utah Code Ann. § 77-13-6(2) (Supp.2005) (emphasis added). Thus, any time after a defendant has entered a guilty plea but before a "sentence is announced," a defendant may move to withdraw a guilty plea. Id.
¶ 16 While the Utah Supreme Court has not addressed the amended plea withdrawal statute, it has recently reaffirmed that the plea withdrawal statute is unequivocally jurisdictional. See State v. Merrill, 2005 UT 34, ¶ 20, 114 P.3d 585 (applying the previous plea withdrawal statute and "confirm[ing] our conclusion ... that [Utah Code] section 77-13-6(2)(b) [(Supp.2004)] is indeed jurisdictional"); see also State v. Mullins, 2005 UT 43, ¶ 11 n. 2, 116 P.3d 374 (applying the previous plea withdrawal statute and noting that in Merrill the court "removed any lingering doubt as to the jurisdictional consequences of a failure to seek a timely withdrawal of a plea").
¶ 17 If we were to conclude that the amended plea withdrawal statute applies to a trial court's sua sponte withdrawal of Defendant's plea, the trial court was without jurisdiction to set aside Defendant's plea in this case. However, Defendant asserts that the amended plea withdrawal statute does not apply to a trial court's sua sponte decision to set aside a guilty plea and only applies to motions made by defendants who seek to withdraw a guilty plea. Accordingly, Defendant concludes that the trial court retained jurisdiction to sua sponte set aside Defendant's plea.
¶ 18 "Our primary goal in interpreting statutes is to give effect to the legislative intent, as evidenced by the plain language, in light of the purpose the statute was meant to achieve." State v. Burns, 2000 UT 56, ¶ 25, 4 P.3d 795. We consider "all parts [of the statute] relevant and meaningful, and... presume the legislature use[d] each term advisedly and ... according to its ordinary meaning." State v. Maestas, 2002 UT 123, ¶ 52, 63 P.3d 621 (emphasis added) (alterations in original) (quotations and citations omitted). We do so in order to "avoid interpretations that will render portions of a statute superfluous or inoperative." Id. (quotations and citations omitted). Finally, we only look beyond the plain language if we determine that the statute is ambiguous. See Burns, 2000 UT 56 at ¶ 25, 4 P.3d 795.
¶ 19 The language of the statute supports Defendant's position that the legislature did not intend the plea withdrawal statute to apply to a trial court's decision to sua sponte set aside a defendant's guilty plea. We agree with Defendant that the plain language of the plea withdrawal statute makes clear that its purpose is to inform a defendant under what conditions and time frame a guilty plea may be withdrawn. Under the plea withdrawal statute, a guilty plea may only be withdrawn with a trial court's permission after a showing that the plea was not knowingly and voluntarily made. See Utah Code Ann. § 77-13-6. The statute explicitly states that "[a] request to withdraw a plea of guilty ... shall be made by motion before *5 sentence[] is announced." Id. (emphases added). It would make no sense for us to hold that a court itself must make a request to set aside a guilty plea by motion. To whom would the court be making such a request? Thus, we conclude that the legislature did not intend that this statute would apply to sua sponte court orders setting aside a defendant's guilty plea.
¶ 20 This conclusion is consistent with our case law, which provides that a court may change its position after accepting a plea and orally imposing sentence but before entering a written order of judgment. In State v. Wright, 904 P.2d 1101 (Utah Ct.App.1995), the trial court orally sentenced the defendant but did not enter a written order. See id. at 1102. A week later, the court stated that it would not enter the sentence until after it reviewed the presentence report, stating "[t]here is no judgment, there is no sentence[,] until I sign those papers." Id. After reviewing the presentence report, the trial court sentenced the defendant to zero to five years in state prison rather than the orally announced sentence of thirty-six months probation. See id. On appeal, we affirmed the trial court's sentence and held that "`the oral statement from the court regarding [the] defendant's sentence was not reduced to writing, and thus [the] defendant's sentence was not entered until [the date it was reduced to writing and signed].'" Id. (third alteration in original) (quoting State v. Curry, 814 P.2d 1150, 1151 (Utah Ct.App.1991)). Thus, the trial court in Wright must have retained jurisdiction in order to alter its orally announced sentence.
¶ 21 Similarly, as we again noted in State v. Todd, 2004 UT App 266, 98 P.3d 46, "[i]t is the law of this state ... that a sentence is not entered until it has been reduced to writing and signed by the court" for purposes of appealing or for a motion for a new trial. Id. at ¶ 15. In Todd, the trial court announced sentence from the bench but did not enter its written sentencing order until two weeks later. See id. at ¶ 10. The defendant in that case filed a motion for a new trial after the oral announcement but before the sentenced was entered. See id. Under rule 24 of the Utah Rules of Criminal Procedure, "[a] motion for a new trial shall be made within ten days after imposition of sentence." Utah R.Crim. P. 24. The defendant argued that the trial court's oral announcement of sentence was the "imposition of sentence" under rule 24. We disagreed and held that the motion was untimely because the sentence had not yet been entered by written order. See Todd, 2004 UT App 266 at ¶ 18, 98 P.3d 46. Accordingly, the trial court in Todd must have retained jurisdiction over the proceedings until it entered sentence by written order.
¶ 22 In addition, there are situations in which a trial court must refuse a defendant's guilty plea because it is duty-bound to protect a criminal defendant's constitutional rights. Utah Rule of Criminal Procedure 11(e) provides that "[t]he court may refuse to accept a plea of guilty ... and may not accept the plea until the court has found," [among other things], that "the plea is voluntarily made." Utah R.Crim. P. 11(e)(2) (emphasis added). The purpose of this rule is to "ensure that defendants know their rights and understand the basic consequences of their decision to plead guilty." State v. Dean, 2004 UT 63, ¶ 9, 95 P.3d 276. Furthermore, "the law places the burden of establishing compliance with those requirements on the trial judge." State v. Gibbons, 740 P.2d 1309, 1313 (Utah 1987). Therefore, because a trial court must "personally establish that the defendant's guilty plea is truly knowing and voluntary," State v. Thurman, 911 P.2d 371, 372 (Utah 1996) (quotations and citation omitted), we hold that the plea withdrawal statute does not apply to a trial court's decision to sua sponte set aside a defendant's plea.
¶ 23 Accordingly, we conclude in the instant case that the trial court had jurisdiction to set aside Defendant's guilty plea after it announced sentence but before it signed the judgment of sentence.

III. Abuse of Discretion
¶ 24 Having concluded the trial court had jurisdiction, we must now determine whether or not the trial court abused its discretion by setting aside Defendant's plea. *6 See State v. Lehi, 2003 UT App 212, ¶ 7, 73 P.3d 985.
¶ 25 "[I]t is well established under Utah law that trial courts are not required to accept plea agreements. This principle is based on the plain language of rule 11 of the Utah Rules of Criminal Procedure, which explicitly provides that `the court may refuse to accept a plea of guilty.'" State v. Montiel, 2005 UT 48, ¶ 13, 531 Utah Adv. Rep. 10 (quoting Utah R.Crim. P. 11(e)). While a trial court cannot arbitrarily refuse to accept a plea agreement, it "has an important role to play in assessing the appropriateness of a proffered plea agreement ... and `may reject a plea in the exercise of sound judicial discretion.'" Id. at ¶ 14 (quoting Santobello v. New York, 404 U.S. 257, 262, 92 S.Ct. 495, 30 L.Ed.2d 427 (1971)). Therefore, considering the broad discretion afforded trial courts in refusing to accept plea agreements, we hold that trial courts likewise have broad discretion to sua sponte set aside a guilty plea before a written order of judgment is entered.
¶ 26 In the instant case, Defendant answered affirmatively when asked whether he understood that he could be deported and not allowed back into the United States. Defendant also stated that he understood the Plea Statement and was prepared to sign it. However, the trial court set aside Defendant's pleas based on "serious concerns that [Defendant mis]underst[ood] the ramifications of what he [was] doing and what a plea to those charges mean[t] to him." The trial court was concerned that because the Plea Statement was written in English, rather than Spanish, Defendant may not have understood that "the plea here [would] eliminate the fact that he will be able to spend any time with his family for the rest of his life." It is not clear whether Defendant understood his rights based upon the trial court's statements at the hearing regarding the trial court's withdrawal of Defendant's plea. Specifically, the trial court stated,
It's been brought to the [c]ourt's attentionin fact, we discussed this at the time that the [P]lea [Statement] itself was in English and not in Spanish. [Defendant] is not fluent in English. This form was translated for him, but based upon information the [c]ourt received, I have serious concerns that [Defendant mis]understands the ramifications of what he is doing and what a plea to these charges means to him.
(Emphasis added.)
¶ 27 Thus, we cannot say the trial court abused its broad discretion by setting aside Defendant's plea. See State v. Dean, 2004 UT 63, ¶ 11, 95 P.3d 276 ("Withdrawal [of a guilty plea] is a privilege, not a right, that is left to the trial court's sound discretion." (quotations and citations omitted)). Therefore, we affirm.

CONCLUSION
¶ 28 We hold that the State has a statutory right to appeal the withdrawal of Defendant's guilty plea. We further conclude the trial court had jurisdiction to sua sponte withdraw Defendant's guilty plea after announcement of his sentence, but before entry of a written judgment. Finally, we conclude the trial court did not abuse its discretion by withdrawing Defendant's guilty plea.
¶ 29 WE CONCUR: RUSSELL W. BENCH, Associate Presiding Judge, and WILLIAM A. THORNE JR., Judge.
