UDF for uadetector