fixed packet handling