updated UI logic