     }
     
     func filterContentForSearchText(searchText: String, scope: String = "All") {
-        filteredPasswordsTableEntries = passwordsTableEntries.filter { entry in
-            return entry.title.lowercased().contains(searchText.lowercased())
-        }
-        if searchController.isActive && searchController.searchBar.text != "" {
-            reloadTableView(data: filteredPasswordsTableEntries)
-        } else {
-            reloadTableView(data: passwordsTableEntries)
-        }
+        switch scope {
+        case "All":
+            filteredPasswordsTableEntries = passwordsTableAllEntries.filter { entry in
+                return entry.title.lowercased().contains(searchText.lowercased())
+            }
+            if searchController.isActive && searchController.searchBar.text != "" {
+                reloadTableView(data: filteredPasswordsTableEntries)
+            } else {
+                reloadTableView(data: passwordsTableAllEntries)
+            }
+        case "Current":
+            filteredPasswordsTableEntries = passwordsTableEntries.filter { entry in
+                return entry.title.lowercased().contains(searchText.lowercased())
+            }
+            if searchController.isActive && searchController.searchBar.text != "" {
+                reloadTableView(data: filteredPasswordsTableEntries)
+            } else {
+                reloadTableView(data: passwordsTableEntries)
+            }
+        default:
+            break
+        }
+        
+        
     }
     
     private func reloadTableView(data: [PasswordsTableEntry], anim: CAAnimation? = nil) {

            backAction(self)
        }
    }
}

extension PasswordsViewController: UISearchResultsUpdating {
    func updateSearchResults(for searchController: UISearchController) {
        filterContentForSearchText(searchText: searchController.searchBar.text!)
    }
}

    }
}

class PasswordsViewController: UIViewController, UITableViewDataSource, UITableViewDelegate, UITabBarControllerDelegate, UISearchBarDelegate {
    private var passwordsTableEntries: [PasswordsTableEntry] = []
    private var passwordsTableAllEntries: [PasswordsTableEntry] = []
    private var filteredPasswordsTableEntries: [PasswordsTableEntry] = []
    private var parentPasswordEntity: PasswordEntity? = nil
    private let passwordStore = PasswordStore.shared
