remove output of type from foreach loop