fix connection/channel closed exception