fixed bug that processing didn't wait for bam merge to finish.