Added directory access protection