TODO: fix 'possible issue with flow control...'