need to fix backtracking of actions in dfs