better keep-alive handling