I have the genecount file generated while using STAR for alignment. The second column of the genecount file (read count of unstranded hits) is supposed to be the exact same as the one counted using HTSeq-count in union mode. However, I noticed it happens to match with the genecount file generated while using STAR only when I give the unsorted bam file as input to the HTSeq. While the count is differs when I give the sorted bam file as input. Why is it so? Which tool count should I rely on for downstream analysis?