working search function for age