csv-update: fixed statement order in for-loop