fixed heartbeat bugs