Detect and handle Heartbeat bug