add a keepalive mechanism