Searching in loop