possible race condition in step_branch_pairs