added keepalive feature