fix the read dir bug