replace readdir by readdirSync