     else
       @homepage.hide()
 
-    if issues = @pack.bugs?.url
+    if issues = @metadata.bugs?.url
       @issues.find('a').attr('href', issues)
     else
       @issues.hide()

      version = loadedPackage?.metadata.version
      unless version
        try
          version = Package.loadMetadata(@pack.name).version
      @updateAvailable = semver.gt(@pack.version, version)

    if @updateAvailable
      @update.show()

      @updateDefaultAction()
      @updateEnabledState()

    @packageEventEmitter.on 'package-installed package-uninstalled package-upgraded', (error, metadata) =>
      if metadata?.name is @metadata.name
        @defaultAction.enable()
        @updatePackageState()
        @updateDefaultAction()

  togglePackageEnablement: ->
    if @disabled
      config.removeAtKeyPath('core.disabledPackages', @metadata.name)
    else
      config.pushAtKeyPath('core.disabledPackages', @metadata.name)

  updatePackageState: ->
    @disabled = atom.isPackageDisabled(@metadata.name)
    @updateAvailable = false
    @bundled = false
    loadedPackage = atom.getLoadedPackage(@metadata.name)
    packagePath = loadedPackage?.path ? atom.resolvePackagePath(@metadata.name)
    @installed = packagePath?
    if @installed
      for packageDirPath in config.bundledPackageDirPaths
