Fix the serialization issue; thanks SO