added ui logic