Added code to save restore saved_error