 
     func refreshLoans(completionHandler: ((success: Bool, error: NSError?) -> Void)? ) {
         
+        guard nextPageOfKivaSearchResults != -1 else {
+            showNoMoreResultsAlert()
+            return
+        }
+        
         // Search Kiva.org for the next page of Loan results.
         CountryLoansKivaApiHelper.populateLoansForCountry(LoansTableViewController.KIVA_LOAN_SEARCH_RESULTS_PER_PAGE, twoLetterCountryCode: self.country?.countryCodeTwoLetter, nextPage: self.nextPageOfKivaSearchResults) {
             success, error, loans, nextPage in


        self.activityIndicator.startActivityIndicator(tableView)
        
        // initialize user's loans
        refreshLoans(nil)
        

                    self.loans.appendContentsOf(loans)
                }
                
                // save the nextPage
                self.nextPageOfKivaSearchResults = nextPage
                
                dispatch_async(dispatch_get_main_queue()) {

