diff --git a/workflow/main.nf b/workflow/main.nf
index 75a25de909ce153c559bc4f39e626b097af48f36..e770f8f78ad1fcb8ac54a15acfa5964b6bef1c36 100644
--- a/workflow/main.nf
+++ b/workflow/main.nf
@@ -384,9 +384,7 @@ process consensusPeaks {
 }
 
 // Define channel to find number of unique experiments
-noUniqueExperiments = Channel
-                      .from(uniqueExperiments.readLines())
-                      .size()
+uniqueExperiments.splitCsv(sep: '\t', header: true).toList().map{ it.size().toInteger() }.set { noUniqueExperiments }
 
 // Annotate Peaks
 process peakAnnotation {
@@ -428,7 +426,7 @@ process diffPeaks {
   file 'normcount_peaksets.txt' into normCountPeaks
 
   script:
-  if (noUniqueExperiments == 2) {
+  if (noUniqueExperiments <= 1) {
     """
     touch design_diffpeak_annotatePeaks.tsv
     touch no_diffbind.bed