no need to cut
catch errors and exit read loop, close all straems when finished