Wouldn't we want this check to be if it's true and then set it to false, like the `onStateChange` function?