update public data in a loop