fix in topologicalSort without Recursion