RB 951G-2Hnd script to add wall Garden IP list not working

Dear Team

I am using RB 951G-2Hnd when i am trying run the script to update the Hotspot wall Garden Ip List.It is not working correctly the url in the list should be 77 but the script is multiple the url.I have this problem with OS 6.23 and 6.33.
Please any one can advice on this matter this problem cause the router hand or reboot it self after 30 min due the memory go down from 128 to 15.

This is the script

/tool fetch url=“http://119.81.192.149/admin/api/wall.txt” mode=http dst-path=wall.txt

:foreach entry in=[/ip hotspot walled-garden find comment=wowfi_system] do={
/ip hotspot walled-garden remove $entry
}

:foreach entry in=[/ip hotspot walled-garden ip find] do={
/ip hotspot walled-garden ip remove $entry
}

:if ( [/file get [/file find name=wall.txt] size] > 0 ) do={
:global content [/file get [/file find name=wall.txt] contents] ;
:global contentLen [ :len $content ] ;
:global lineEnd 0;
:global line “”;
:global lastEnd 0;
:do {
:set lineEnd [:find $content “\n” $lastEnd] ;
:set line [:pick $content $lastEnd $lineEnd] ;
:set lastEnd ( $lineEnd + 1 ) ;
:if ( [:pick $line 0 1] != “#” ) do={
:global entry [:pick $line 0 ($lineEnd)]
:if ( [:len $entry ] > 0 ) do={
/ip hotspot walled-garden add dst-host=$entry comment=“wowfi_system” server=hotspot1
/ip hotspot walled-garden ip add action=accept comment=$entry disabled=no dst-host=$entry dst-port=1-65535 server=hotspot1
}
}
} while ($lineEnd < $contentLen)
}

Any Advice team