Error handling for heartbeat