fixed search algorithm so that it wouldn't return after the first false find