properly update branch variable after removing nils from vr