get dirname instead of filename