Creates function to search by name