fixed method that get branch name