Add foreach fix(maybe depends on php version)