added persistent mode