     }
 }
 
-open class CountryPicker: UIPickerView, UIPickerViewDelegate, UIPickerViewDataSource {
+open class CountryPicker: UIPickerView, UIPickerViewDelegate, UIPickerViewDataSource, UIGestureRecognizerDelegate {
 
     lazy var countries: [Country] = {
         var allCountries: [Country] = CountryPicker.countryNamesByCode()
         if let display = displayOnlyCountriesWithCodes {
             let filtered = allCountries.filter { country in return display.contains(where: { code in return country.code == code }) }
+            return filtered
         }
         return allCountries
-    }
+    }()
     open var displayOnlyCountriesWithCodes: [String]?
     open weak var countryPickerDelegate: CountryPickerDelegate?
     open var showPhoneNumbers: Bool = false

            countryPickerDelegate.countryPhoneCodePicker(self, didSelectCountryWithName: country.name!, countryCode: country.code!, phoneCode: country.phoneCode!, flag: country.flag!)
        }
    }
}

    func setup() {
        super.dataSource = self
        super.delegate = self

        let tap = UITapGestureRecognizer(target: self, action: #selector(pickerTapped(tapRecognizer:)))
        tap.cancelsTouchesInView = false
        tap.delegate = self
        self.addGestureRecognizer(tap)
    }

    // MARK: - Country Methods
