fix issues with object serialization