fixing dfs call bug