added archivetime flag to control the cleanUP function