Need a way to get around this

execute as @a if entity @s[nbt={equipment:{head:{id:"minecraft:carrot_on_a_stick",components:{"minecraft:custom_model_data":{strings:["prophat"]}}}}}] if items entity @s weapon.mainhand carrot_on_a_stick[custom_model_data={strings:["prophat"]}] run item replace entity @s weapon.mainhand with air
execute as @a[scores={carrot_used=1..}] at @s run playsound minecraft:item.armor.equip_leather master @s ~ ~ ~ 1 1.5```

so, if the players score matches that and they have nothing else on their head it sets it to that item, but then if they have that in their hand it clears it,

the problems this makes is if they right click the item but they have already have it on their head it still deletes the item in their hand, what do I do to avoid this
Continue to help post