Need Help with If statement

So, in my actions layer I have something like
if (variable1 == true && variable2 == true)
{ some stuff
}
variable1 and variable 2 are global variables.
later on the same page
I change the values of variable 1 and variable 2 to false.
After that I set them to true again
Also when I trace, I can clearly see that both are set to true again. However “some stuff” doesnt work for the second time. It only works on stage entrance. I tried using for, instead of if, didn’t make any difference.