Adding check for file ownership