add some functions in branchpeer