fix flow control handling