fixed bug with packet length padding