fix build_packet