added support for keep-alive connections