add msg length byte checking to header confirmation
add calculated packet length instead of static