only sleep when at end of data stream