DFS doesn't work on large data set