Only change protection key of files, not folders
Test the events instead of the file
Updated documentation