This code always updates the first portlet element.  What if there are 5 or 6 portlets in the class and the new one that is being added is the last portlet?