Tablet device broke the whole system of scripts

So originally this script with serverside script makes datastore to know which device bought the gamepass most, but after i have added “tablet” as device, it broke my mobile, console script and it doesnt create datastore for tablet?

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("DeviceEvent")

local device

if UserInputService.TouchEnabled then
    if UserInputService:IsMouseButtonDown(Enum.UserInputType.MouseButton1) then
        device = "Mobile"
    else
        device = "Tablet"
    end
elseif UserInputService.KeyboardEnabled then
    device = "PC"
else
    device = "Console"
end

remoteEvent:FireServer(device)

The most profitable devices for sponsor games on Roblox and how to count by script? - Help and Feedback / Scripting Support - Developer Forum | Roblox

But with this localscript, everything works fine for these 3 devices:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("DeviceEvent")

local device

if UserInputService.TouchEnabled then
    device = "Mobile"
elseif UserInputService.KeyboardEnabled then
    device = "PC"
else
    device = "Console"
end

remoteEvent:FireServer(device)

“:IsMouseButtonDown()” isn’t a function of user input service. Also I don’t think checking a mouse click for mobile and tablet users will work