do serialization correctly