[fix] bug on the parameters for foreach()