try to fix dirname bug