Whoops,

and check also the numbers of ENDIFs against the number of IFs in your first script
_________________________