fixed serialization of objects