goal search loop fix