modified watcher to allow for testing