use channel to mark that we are done reading