cleanliness

close open connections, ensure streaming completes before exiting