fix ext foreach