what is the most effective way to handle the click on a ui element that is not always available?