changed from polling to pyinotify algorithm