Find Peaks: Ensure script is aborted when dialog is dismissed.