fix iteration through searching