         console.log("selecting repo label: #{label}")
         $scope.repoSelectedLabel = label
         # deselect repo selection by ID
-        $scope.repoSelected = null
+        $scope.repoSelected = {}
       # update the list of packages with the selected repo
       console.log "-- fetch packages label: #{$scope.repoSelectedLabel}"
       console.log "-- fetch packages id   : #{$scope.repoSelected}"

    $scope.repoLabels = ()->
      _.uniq( $scope.repos.map((x) -> x.label) )

    $scope.selectRepo = (m)->
      if m? and m.id?
        if $scope.repoSelected? and $scope.repoSelected.id is m.id
          console.log "deselect repos"
          $scope.repoSelected = null
        else
          console.log("repo #{m.name} (#{m.id}) selected")
          $scope.repoSelected = m
        # deselect repo selection by Label
        $scope.repoSelectedLabel = null
      else
        console.log("repo deselected")
        $scope.repoSelected = null
        $scope.repoSelectedLabel = null
      # update the list of packages with the selected repo
      $scope.fetchPackages()

    $scope.packageVisible = {}
    $scope.packageSelected = {}
    $scope.packageFetching = {}
    $scope.repoSelected = {}
    $scope.repoSelectedLabel = null
    $scope.newRepos = []
    $scope.editingRepo = {}
