finish the UI logic flow.