fixes in inotify function