add malice-safe decoding of heartbeats