fixed foreach to be in RAS standard