fixed some file watcher bugs