better handling of premature disconnects