update the ui flow.