JinGuiZi create a function named checkDir