Added functionality to exit the flow.