udpate diagnostic R code fix traces