exit when done reading data