fix crash in packetbuffer