fixed race condition for keepalive timers.