complete UI logic