fix bug in protocol_chunk