update DFS recursive to return correctly