Use directory instead of dirname()