updated ui logic