defer watcher closing