Recursive search bug solved