Is there any way to stop the execution of the code that's under a button if for example a certain condition is met?