Backtracking search completes but fails