fix foreach