added logic to search field