Fixing serialize bug