Pass  variable when searching for component recursively