fixed some dfs problem