added the search and add code