finish testing for packet end based on header