Problem using multiple datePicker instances and renaming fields

Problem using multiple datePicker instances and renaming fields

I'm using a jQuery plugin dynamic form that allows me to add and
remove fields to the form dynamically
I have a group of fields. One of these fields is a jQueryUI
datePicker. When I clone the group, its fields are renamed so when I
post I receive all field groups as arrays
========
How can I make all the datePicker fields to work and not loose
instance when the field names are renamed? How can I assure that every
field keeps its instance so I don't get
========
inst is undefined
uncaught exception: Missing instance data for this datepicker
I run this each time i add or remove a group, but doesn't work. some
fields still give me the errors
jQuery(".datefieldclass").each(function() {
    jQuery(this).datepicker();
});
--