check for $branch, not head