update loop for