Do not create unnecessary directory resource

Only create the resource when we actually need it, versus a resource that has a simple guard.