add watcher code