fix foreach part