Version with persistence and infite loop