looping
problem with search function