added keepalive support