better support for keep alive connection