         $scope.offset = $scope.limit * (page-1)
         $scope.search()
 
-      if parseInt($scope.maxResults) > ($scope.offset + $scope.limit)
+
+      console.log("MAX RESULTS", $scope.maxResults())
+
+      if parseInt($scope.maxResults()) > ($scope.offset + $scope.limit)
         $scope.next = ->
           $scope.offset = $scope.offset + $scope.limit
           $scope.search()

      $scope.totalCount = $scope.partyCount + $scope.volumeCount

      $scope.minPage = 1
      $scope.maxPage = 1 + ($scope.maxResults / ($scope.limit + 1))
      pageRange = []
      for i in [$scope.minPage .. $scope.maxPage] by 1
        pageRange.push(i)


    $scope.updateFilterBoxOptions = ->
      console.log("SELTYPE", $scope.selectedType)
      if $scope.selectedType and $scope.filterDisplay.length == 0
        if $scope.selectedType.join(" ").includes($scope.volumeDisplayStr)
          $scope.filterDisplay = (s for s in $scope.getVolumeFeatureBoxOpts())
        if $scope.selectedType.join(" ").includes($scope.partyDisplayStr)
