Fix the last packet getting shortened