Adding steps limit. Prevent runaway backtracking.