Adding UI logic.