modify foreach