Could you add some @error @serror checks in the UDF's ?