The pageVariable is supposed to be set to its 'initial Value' every time the page is opened. But the pageVariable is only set the first time. When the user changes the page and returns to to page later, the pageVariable still keeps the value from the past. This results in unexpected behaviour of the app.