better handling for broken packets