fix bug in readdirSync