correct device.platform conditional