Fix error in branch controller