Code not reliable - any way to 'foolproof'?

It’s because you have a “leftover” click handler on the entire page.
Select the page and remove the “page1_click” click handler in the properties panel: