now we detect the branch automatically