fixes flow control issue