
267 P.3d 365 (2011)
164 Wash.App. 617
STATE of Washington, Respondent,
v.
Michael David CRAWFORD, Appellant.
In the Matter of the Personal Restraint of Michael David Crawford.
No. 67169-3-I.
Court of Appeals of Washington, Division 1.
September 19, 2011.
Publication Ordered November 7, 2011.
*366 Thomas Edward Doyle, Attorney at Law, Hansville, WA, for Appellant.
Michael David Crawford, Aberdeen, WA, Petitioner Pro Se.
John C. Skinder, Carol L. La Verne, Thurston County Prosecutor's Office, Olympia, WA, for Respondent.
BECKER, J.
¶ 1 Community custody is a portion of an offender's sentence that is served in the community. Therefore, an offender is not under community custody while in jail. Because appellant was not under community custody when he committed the crime, it was error to add an extra point to his offender score.
¶ 2 Michael Crawford was convicted of assault in 2005 and sentenced to prison. He was released in September 2008 and began serving a term of community custody. On December 15, 2008, while still under community custody, he was arrested for eluding police and possessing heroin and morphine. *367 He was taken into custody on December 15. He was tried on the eluding and possession charges on February 25, 2009. Because he did not make bail, he remained in the custody of the jail until and throughout the trial.
¶ 3 At the trial, Crawford testified that he had not been driving the car during the eluding incident. He claimed a woman was driving and escaped before police could apprehend her. He was convicted as charged and sentenced to 27 months of confinement.
¶ 4 The State charged Crawford with perjury for his trial testimony. The affidavit of probable cause set forth the testimony to be offered by the State. Several officers would testify that Crawford was the only person in the vehicle, he was seen driving, no one left the scene, the driver's side door of the vehicle could not be opened, and Crawford told police he had tried to drive away to escape arrest. The State offered to recommend the low end of the standard sentencing range and for the sentence to run concurrently with his sentence for eluding if Crawford would plead guilty.
¶ 5 On July 23, 2009, Crawford pled guilty to perjury. The court sentenced Crawford the same day. At the sentencing hearing, the prosecutor calculated the offender score as 8: 6 points for prior felonies, 1 point for juvenile convictions, and 1 point because the crime of perjury was committed while Crawford was under community custody. Crawford and defense counsel agreed that the score was correctly calculated. The standard range was determined at 62 months to 82 months for a score of 8. The court sentenced Crawford to 62 months of confinement to run concurrently with the sentence on the eluding conviction.
¶ 6 On March 8, 2010, Crawford filed a motion pro se to correct or modify his judgment and sentence under CrR 7.8 (relief from judgment). He argued under CrR 7.8(a) that the offender score of 8 was a clerical error and should have been 7. He alternatively argued that the offender score was entered as 8 by mistake, CrR 7.8(b)(1), or by misrepresentation of the facts by the prosecution, CrR 7.8(b)(3). The score should have been 7, he argued, because he was incarcerated on the eluding and drug charges at the time he committed perjury and therefore was not under community custody, a status incompatible with incarceration.
¶ 7 On April 8, 2010, the trial court denied the motion:
THE COURT: It appears that the defendant's position is he was in jail because the perjury was committed while he was at trial and he was being held on that. In this court's opinion that doesn't mean that he wasn't still on community custody even though he was in custody. That community custody period continues to run. I will deny his motion.
¶ 8 On May 4, 2010, Crawford filed a notice of appeal of the order denying his motion.
¶ 9 On May 17, 2010, Crawford filed a personal restraint petition similarly challenging the accuracy of the calculation of his offender score. He pointed out that the box for adding a point for committing the offense while under community custody had not been checked. The State responded that the court's oral ruling showed that the failure to check the box was merely a scrivener's error and that the score was correctly calculated as 8.
¶ 10 Counsel was appointed to represent Crawford in his personal restraint petition. Crawford's personal restraint petition has been consolidated with his direct appeal at his request.
¶ 11 To prevail in his appeal of the ruling on the CrR 7.8 motion, Crawford must show the trial court abused its discretion. State v. Gomez-Florencio, 88 Wash.App. 254, 258, 945 P.2d 228 (1997), review denied, 134 Wash.2d 1026, 958 P.2d 314 (1998). A trial court necessarily abuses its discretion if it bases its ruling on an erroneous view of the law. State v. Harvill, 169 Wash.2d 254, 259, 234 P.3d 1166 (2010).
¶ 12 To prevail on his personal restraint petition, because it is not based on constitutional grounds, Crawford must establish that he is being unlawfully restrained due to a fundamental defect which inherently results in a complete miscarriage of justice. In re Goodwin, 146 Wash.2d 861, 867, 50 P.3d 618 (2002). This test is satisfied by *368 showing that a sentence was based upon a miscalculated offender score. In re Goodwin, 146 Wash.2d at 876, 50 P.3d 618.
¶ 13 Miscalculation of Crawford's offender score based on an erroneous view of the law would constitute both an abuse of discretion and a complete miscarriage of justice. The single issue presented is whether, under the Sentencing Reform Act of 1981, a defendant who is arrested while under community custody remains under community custody while confined in jail during trial on the new charges.
¶ 14 Interpretation of the Sentencing Reform Act is a question of law that we review de novo. When interpreting a statute, the court's objective is to determine the legislature's intent. If the meaning of a statute is plain on its face, we give effect to that plain meaning. To determine the plain meaning of a statute, we look to the text, as well as the context of the statute in which that provision is found, related provisions, and the statutory scheme as a whole. State v. Jones, 172 Wash.2d 236, 242-43, 257 P.3d 616 (Wash.2011).
¶ 15 The Sentencing Reform Act requires a 1-point increase in a defendant's offender score if the crime for which the defendant is being sentenced was committed while the defendant was "under community custody":
If the present conviction is for an offense committed while the offender was under community custody, add one point. For purposes of this subsection, community custody includes community placement or postrelease supervision, as defined in chapter 9.94B RCW.
Former RCW 9.94A.525(19) (2008). The act defines "community custody" as a portion of a sentence an offender serves "in the community" while subject to control of his movements and activities by the Department of Corrections:
(5) "Community Custody" means that portion of an offender's sentence of confinement in lieu of earned release time or imposed pursuant to RCW 9.94A.505(2)(b), 9.94A.650 through 9.94A.670, 9.94A.690, 9.94A.700 through 9.94A.715, or 9.94A.545, served in the community subject to controls placed on the offender's movement and activities by the department.
Former RCW 9.94A.030(5) (2008) (emphasis added). "Any period of community custody... shall be tolled during any period of time the offender is in confinement for any reason." Former RCW 9.94A.625(3) (2008).
¶ 16 When Crawford committed perjury during trial on the eluding charge, it was during a period of time when he was confined in jail. He points out that his confinement in jail tolled his term of community custody. The State responds that the tolling statute does not remove an offender from the status of being under community custody; it simply ensures that the offender will serve his full term of community custody without any deduction for time spent in confinement. Because an offender has not completed his term of community custody when a tolling period commences, the State asserts, he remains under community custody during the tolled period.
¶ 17 A term of community custody is tolled when an offender is in confinement because the offender is not then serving a portion of his sentence "in the community." Thus, time spent incarcerated does not meet the definition of "community custody." See Jones, 172 Wash.2d at 243-45, 257 P.3d 616. The nature of community custody is such that an offender cannot be simultaneously incarcerated and "under community custody."
¶ 18 Because Crawford was not serving time in the community when he committed perjury, the point added to his offender score for committing the perjury under community custody was unauthorized.
¶ 19 The State alternatively argues that it is not fair to lower Crawford's offender score and sentence because he agreed to them as part of a plea agreement. By the agreement, he obtained the State's promise to recommend the sentence run concurrently with his other sentence, instead of consecutively as could have been imposed. The State cites no authority for this argument. Nor does the State suggest that Crawford's remedy is to vacate the plea agreement if he shows that his offender score *369 was miscalculated. The State's position appears to contradict Goodwin, in which the court held that a defendant cannot agree to punishment in excess of that which the legislature has established. Waiver does not apply where the alleged sentencing error is a legal error. In re Goodwin, 146 Wash.2d at 873-74, 50 P.3d 618.
¶ 20 Because the addition of a point to Crawford's offender score was based on misinterpretation of the Sentencing Reform Act's community custody provision, it is a legal error and Crawford's agreement was not a valid waiver. The sentence is an unlawful restraint. Crawford's motion to correct his sentence should have been granted. Crawford prevails in his appeal and in his personal restraint petition.
¶ 21 We remand for the court to recalculate Crawford's offender score and resentence him accordingly.
WE CONCUR: DWYER, C.J. and ELLINGTON, J.
