change the for-each statement