made serialization safer