Fixed a bug that the server heartbeat stopped occasionally.