diff --git a/src/RNAseq_sen1D.nf b/src/RNAseq_sen1D.nf
index 361028cbac69bfc533ab40bd24c6a5aed0517252..13269ddaa2bdc6fc6c12b51d10796ffefa8bb368 100644
--- a/src/RNAseq_sen1D.nf
+++ b/src/RNAseq_sen1D.nf
@@ -157,17 +157,11 @@ fi
 }
 
 /*                      bams sorting                                    */
+
 process sort_bam {
-  tag "${pair_id}.bam"
+  tag "$bam.baseName"
   cpus 4
 
-  input:
-    file bam from bam_files
-
-  output:
-    file "*_sorted.bam" into sorted_bam_files
-
-  script:
 """
 samtools sort -@ ${task.cpus} -O BAM -o ${bam.baseName}_sorted.bam ${bam}
 """