serializing correctly