UpdateUI function introduced.