flush outside foreach