Added keepalive thread