update with a loop