fix return type check for reading bam