implemented serialization