update ui logic