Now works when last packet size is exactly 1000 bytes