fixed foreach