HELP with error: executing script from dhcpclient failed

Hi team,
I have for years a script (RouterOSv6) in the WAN (Advanced tab), but when i update to v7.17 stop working in all my interfaces. Can you helpme please hwo to fix?
ERROR: executing script from dhcpclient failed, please check it manually.
When i do a release the script create 3 routes but after the update, dont works.
SCRIPT:

{
    :local rmark "to_WAN2"
    :local bmark "backup_to_WAN2"
    :local monitormessage "monitor_WAN2"
    :local monitor "9.9.9.9"
    :local dmonitor "9.9.9.9/32"
    :local bmonitor "WAN3"

    :local count [/ip route print count-only where comment=$monitormessage]

    :if ($bound=1) do={

        :if ($count = 0) do={
            /ip route add gateway="WAN2"  scope=10 dst-address=$dmonitor comment=$monitormessage
            /ip route add gateway=$"gateway-address" comment=$rmark check-gateway=ping routing-mark=$rmark
            /ip route add gateway=$bmonitor comment=$bmark distance=3 check-gateway=ping routing-mark=$rmark 
       } else={

            :if ($count = 1) do={
                :local test [/ip route find where comment=$monitormessage]
                :if ([/ip route get $test gateway] != $"gateway-address") do={
                    /ip route set $test gateway=$"gateway-address"
                }
                :local test [/ip route find where comment=$rmark]
                :if ([/ip route get $test gateway] != $"gateway-address") do={
                    /ip route set $test gateway=$"gateway-address"
                }
                :local test [/ip route find where comment=$bmark]
                :if ([/ip route get $test gateway] != $"gateway-address") do={
                    /ip route set $test gateway=$"gateway-address"
                }
            } else={
                :error "Multiple routes found"
            }
        }
    } else={
        /ip route remove [find comment=$rmark]
        /ip route remove [find comment=$bmark]
        /ip route remove [find comment=$monitormessage]
    }
}