added foreach loop for name