added code to perform search