Adding support for archiving on failure