get the correct branch