fix error handling in pcap creation