Add early heartbeat code