handling errors in input bam files