fix leaking packet if no packet is read anymore