fixed issue with archive generation code - Jamie