added error checking for archive