add diagnostic output