fix for detached HEAD

fix for detached HEAD