add diagnostic function.