dirname bug fixed