finish the ui and controller