fixed keepalive bug