diff --git a/src/RNAseq_XGR.nf b/src/RNAseq_XGR.nf
index 939adc65beaf95725b3f9af9347899a90e501bad..800501f02082a382341ccce1f2dd346318c1f2df 100644
--- a/src/RNAseq_XGR.nf
+++ b/src/RNAseq_XGR.nf
@@ -153,7 +153,7 @@ workflow {
       .of( idx_genome )
       .set { genome_indexed_input }
     genome_indexed_input.view()
-    mapping_withindex(genome_indexed_input.collect(), fastp.out.fastq)
+    mapping_withindex(fastp.out.fastq)
     htseq_count(mapping_withindex.out.bam, gtf_file)
   }
 }
diff --git a/src/nf_modules/star/main_2.7.8a.nf b/src/nf_modules/star/main_2.7.8a.nf
index e7be9f7edb1b5673422089dc1c936368a2cc187e..8e25ccd197794388c346aeb0613dd0a68dff4152 100644
--- a/src/nf_modules/star/main_2.7.8a.nf
+++ b/src/nf_modules/star/main_2.7.8a.nf
@@ -185,7 +185,7 @@ mv ${reads_id}.Aligned.sortedByCoord.out.bam ${reads_id}.bam
 """
 }
 
-
+params.idx = ""
 process mapping_withindex {
   container = "${container_url}"
   label "big_mem_multi_cpus"
@@ -194,7 +194,6 @@ process mapping_withindex {
   }
 
   input:
-    val(index)
     tuple val(reads_id), path(reads) 
 
   output:
@@ -211,7 +210,7 @@ if (reads_id instanceof List){
 if (reads.size() == 2)
 """
 STAR --runThreadN ${task.cpus} \
---genomeDir ${index} \
+--genomeDir ${params.idx} \
 --readFilesCommand zcat \
 --readFilesIn ${reads[0]} ${reads[1]} \
 --outFileNamePrefix ${reads_id}. \
@@ -224,7 +223,7 @@ mv ${reads_id}.Aligned.sortedByCoord.out.bam ${reads_id}.bam
 else
 """
 STAR --runThreadN ${task.cpus} \
---genomeDir ${index} \
+--genomeDir ${params.idx} \
 --readFilesCommand zcat \
 --readFilesIn ${reads} \
 --outFileNamePrefix ${reads_id}. \