create a map of device id to its array
check if it exists