     */
     override func gotSelectedIngredient(selected: PFIngredient) {
         var userList = listObject.objectForKey(ingredientsColumnName) as! [PFIngredient]
-        if userList.contains(selected) && selected.isDataAvailable() {
-            addIngredientPromptLabel.text = "\(selected.name)\(alreadyContains)"
-        } else {
+        if !(userList.contains(selected) && selected.isDataAvailable()) {
+            // add ingredient to list:
             userList.append(selected)
             listObject.setObject(userList, forKey: ingredientsColumnName)
             listObject.saveInBackground()
-            if selected.isDataAvailable() {
-                addIngredientPromptLabel.text = "Added \(selected.name)"
-            }
+            
+            // return to list page
+            self.navigationController?.popViewControllerAnimated(true)
         }
     }
     

    */
    override func viewDidAppear(animated: Bool) {
        super.viewDidAppear(animated)
        
        // set ingredient prompt to the use list name:
        addIngredientPromptLabel.text = "\(addIngredientPrompt)\(listTitle)"
        
        // Get navigation bar on top:
        if let navi = self.tabBarController?.navigationController

        ingredientSearchBar = addIngredientSearchBar
        searchTable = addIngredientTableView
        
        // set ingredient prompt to the use list name:
        addIngredientPromptLabel.text = "\(addIngredientPrompt)\(listTitle)"
        
        super.viewDidLoad()
        
