fixed keepalive failure handling