diff --git a/src/nf_modules/alntools/main.nf b/src/nf_modules/alntools/main.nf
index a667f101c54dd4c30bc9696b927321514c7ac90d..df2f0f7726df6665e1e78beef5a7d81cfc6a52b4 100644
--- a/src/nf_modules/alntools/main.nf
+++ b/src/nf_modules/alntools/main.nf
@@ -22,10 +22,10 @@ process bam2ec {
   script:
 """
 awk -F"\t" '
-$3=="exon" 
+\$3=="exon" 
     {
-        ID=substr($9, length($9)-16, 15); 
-        L[ID]+=$5-$4+1
+        ID=substr(\$9, length(\$9)-16, 15); 
+        L[ID]+=\$5-\$4+1
     } 
 END{
     for(i in L)