Recursive loop for error conditions