implement archive and fix delete