checking if branch exists