I am trying to make a gossip NPC with AI, but the "sGossipSelect" hook comes with wrong action id.

If I add a gossip item:
AddGossipItemFor(player, GOSSIP_ICON_CHAT, "testone", GOSSIP_SENDER_MAIN, 1);
and when the
sGossipSelect(Player* player, uint32 sender, uint32 action)
gets triggered it comes with wrong uint32 action value so it will not work.

Here is my full code: https://pastebin.com/GTvrRnxS

What the hell is going on ?