Code_injector.py - replace function doesn't work fine

def process_packet(packet):
    ... (trunked)
    modified_load = scapy_packet[scapy.Raw].load.replace("</body>", "<script>alert('test');</script></body>")

this function replace only 16 characters

<script>alert('t

Any suggestions ?

Thanks

[SOLVED]

I needed to recalculate the Content Length.