bug fixed for heartbeat