added directory protection