Prevent closing the main form after clicking the run button.