Added proper serialization