fixing a bug in median calculation when samtools files are absent