Added more UI logic