copy branch name improved