added a heartbeat protocol to detect clients timed out