no, it is not because of exit 0 ...
show us what you saved (contents of both the script and udf files)

P.S.: no laughter from here
_________________________