Lorawan interrupt example IsLoRaMacNetworkJoined

In the example is a variable IsLoRaMacNetworkJoined. If the cubecell has a lorawan connection this variable is always true after wake up? Is there a way to rejoin if the variable is false?

case DEVICE_STATE_SLEEP:
{
if (accelWoke) {
if (IsLoRaMacNetworkJoined) {
if(prepareTxFrame(APPPORT)) {
LoRaWAN.send();
}
}
accelWoke = false;
}
LoRaWAN.sleep();
break;

this should do the trick:

if (IsLoRaMacNetworkJoined) {
     if(prepareTxFrame(APPPORT)) {
           LoRaWAN.send();
     }
   }else{
      deviceState = DEVICE_STATE_INIT; //force it to go through the initialization again.
}

thanks this was also my solution