fixed packet parsing