Ui loop improvement