improved resource watcher hack