You don't need this variable at all. Wherever you use it, replace it with loadedDrivers.length...