Added search logic