dirname bug fixed 2