removed a foreach in update