In my case, Taazz's solution was better because I have a hidden page that I use to display various debugging info. I unhide it for testing and rehide it for the release. I just skip to the first page when the last normally visible page is active. However, in normal cases, I can see where your solution, zoltanleo, would be more optimal.