PR changes for depthfirst search issue