pass node as parameter to dir recursion func