fixed current branch handling