restoring after error