fix bug in auto mkdir