proper check of the file permissions