Added logic for searching the fields