Sorry about that yeah - i just realized my mistake as well - i copied the working function to another spot in my script but forgot to chage the function name. Learned on thing in that one can have multiple UDF with the same name but Kixtart takes the last one as good.