fixed count problem for branches