Implement threading as well as a 'Stop' button. Everytime the 'Merge' button is pressed, it will start a thread which can be aborted by pressing 'Stop'.