Fixed missing foreach