fixed the running flag in the heartbeat