     }
     
     func changeNumPins() {
+        guard let placeArray = placeArray, placeArray.count > 0 else { return }
         removeExistingPins()
-        
-        let end = min(placeArray!.count, numResults)
+        let end = min(placeArray.count, numResults)
         print("placing \(end) pins")
-        self.addPlaces(places: Array(placeArray![..<end]))
+        self.addPlaces(places: Array(placeArray[..<end]))
     }
     
     func removeExistingPins() {

                if self.moreControl.selectedSegmentIndex == 1 {
                    self.numResults = 20
                }
                let end = min(self.placeArray!.count, self.numResults)
                self.addPlaces(places: Array(places[..<end]))
            }
        }) { (error: Error) in

                if let places = places {
                    self.removeExistingPins()
                    self.placeArray = places
                    if let places = self.placeArray {
                        let end = min(places.count, self.numResults)
                        self.addPlaces(places: Array(places[..<end]))
                    }
                }
            }, failure: { (error: Error) in
                print("error fetching places based on search term: \(searchText). Error: \(error)")
