AllDevices array is set to 0 after addign the new device to the map