Only write to pipe if the packet was good