fix heartbeat bug