fixed bug in saving date.  upsert now works!