328 i/o error unclosed connection fix

Fixes #328