creating delegate to do search