Adding fixes for closing client connection from server