added check for empty bam file