Fix for search iteration issue