added code that tells client when ready to accept more data