add the function of the text watcher