Multi State Box: How to read state stored inside variable?

I have a bit of code that i’m trying to get to work. I managed to store the Multi State Box state inside of the variable I set with “let” but when I go to check if the State stored is true within the if-statement I get a returned value of false. Check it out. Its in order just like so.


 let currentstateB; 

$w(“#backb3”).onClick(() => {
if (currentstateB === $w(‘#Phone’)) {
$w(“#FormBox”).changeState(“Phone”);
//True
} else {
console.log(“Error”);
//False
}
})

//nextb1 Previous State Capture
$w(“#nextb1”).onClick(() => {
currentstateB = $w(“#FormBox”).currentState;
console.log(currentstateB);
})

Whenever I click on the backb3 all i get retured is false…
console.log(currentstateB); returns a value of $w(‘#Phone’)

So in my mind you click nextb1, it saves the currentState, then if need be you click backb3 which should return you to the state stored within the variable currentstateB…