adjusted new device logic to include more reliable userId value