added watcher function