bug fix with heartbeat