Changed an error on foreach()