finish backtracking