used pyinotify instead of watcdog and fixed undo file function