Add custom serialization