fix archive and database bugs
database fix