make sure deviceId always exists