finish dfs