Use variable name "driveid" consistently (instead of "device").