fixed keepalive timeout handling