fixed heartbeat bug