making object serialization more robust