fix bug: don't read data until we can send them out