RouterOS 4.5 & if IP changed, send an e-mail not working

This script not working. If I change $temp != $b to $temp = $b, nothing happing
I think problem is in the beginning, because start-once run count not changed and if I run start-once manually, script not send email…
How can I fix it?

:if ([/system scheduler get check run-count]<=1) do={
/system script run start-once
}
:global temp
:global b
:set temp $a
:set b [ /ip address get [/ip address find interface=ether1] address ]

:if ($temp != $b) do={
/tool e-mail send to=my@email.com subject=“The dynamic IP gets changed on host $b”
:set a $b
}

#start-once
:global a
:set a [/ip address get [/ip address find interface=ether1] address ]

I fix it my self:
:global a;
:global b;
:global t;
:global d;
:if ([ :typeof $a ] = nil ) do={
:set a [/ip address get [find interface=“ether1”] address ]
;
}
:set d [/system clock get date];
:set t [/system clock get time];
:set b [/ip address get [find interface=“ether1”] address ]
;
:if ($a != $b) do={
/tool e-mail send to=my@mail.com subject=“The dynamic IP gets changed to $b” body=“$d\n $t”;
:set a $b;
}