Updating foreach