Fixed the flow dialog to use the final function as the controller.