search function enhance