Refactor code for watching file on OS X
Fix an issue when watching memo does not exist