fix bug in getting branch data