add setTextContents function in UI