fixed merge_sam_files