fix bug for heartbeat