adding search function