No idea why allDevices keeps getting cleared