fix a bug about dir