fixed search and delete functionality