changed marshalling to handle by bytes