serialization function added