How does that work? Do you have a global variable that's set to false once an event has been triggered or something?

Still, in your case you still have to look for what's on top or not right?