fix problem in index bam stage with output directories