initialized the search function