Mac directory crash fix