fixes recursive search issue