more robust keepalive, remerge patch from destogl