inheritance
fix serializeToBuffer