add flow control