fix endless search loop