added buffer for serializing data