It's a little convoluted, couldn't you just use one variable and increase it for each page? Anyway to fix it you can have button A pressed as a top event, then the other logic can be included as sub events with Else, that way it will only check one at a time on the button press and not run through them all.