implement deserialization